1
1
"""Add initial models
2
2
3
- Revision ID: d117aba82184
3
+ Revision ID: 9bc8667ab6a6
4
4
Revises:
5
- Create Date: 2021-09-09 21:15:39.715853
5
+ Create Date: 2021-09-10 16:00:02.842263
6
6
7
7
"""
8
8
from alembic import op
9
9
import sqlalchemy as sa
10
10
11
11
12
12
# revision identifiers, used by Alembic.
13
- revision = "d117aba82184 "
13
+ revision = "9bc8667ab6a6 "
14
14
down_revision = None
15
15
branch_labels = None
16
16
depends_on = None
@@ -21,21 +21,21 @@ def upgrade():
21
21
op .create_table (
22
22
"directors" ,
23
23
sa .Column ("id" , sa .Integer (), nullable = False ),
24
- sa .Column ("name" , sa .String (), nullable = True ),
24
+ sa .Column ("name" , sa .String (), nullable = False ),
25
25
sa .PrimaryKeyConstraint ("id" ),
26
26
)
27
27
op .create_index (op .f ("ix_directors_id" ), "directors" , ["id" ], unique = False )
28
28
op .create_index (op .f ("ix_directors_name" ), "directors" , ["name" ], unique = True )
29
29
op .create_table (
30
30
"movies" ,
31
31
sa .Column ("id" , sa .Integer (), nullable = False ),
32
- sa .Column ("title" , sa .String (), nullable = True ),
33
- sa .Column ("imdb_id" , sa .String (), nullable = True ),
34
- sa .Column ("year" , sa .Integer (), nullable = True ),
35
- sa .Column ("image_url" , sa .String (), nullable = True ),
36
- sa .Column ("imdb_rating" , sa .Float (), nullable = True ),
37
- sa .Column ("imdb_rating_count" , sa .String (), nullable = True ),
38
- sa .Column ("director_id" , sa .Integer (), nullable = True ),
32
+ sa .Column ("title" , sa .String (), nullable = False ),
33
+ sa .Column ("imdb_id" , sa .String (), nullable = False ),
34
+ sa .Column ("year" , sa .Integer (), nullable = False ),
35
+ sa .Column ("image_url" , sa .String (), nullable = False ),
36
+ sa .Column ("imdb_rating" , sa .Float (), nullable = False ),
37
+ sa .Column ("imdb_rating_count" , sa .String (), nullable = False ),
38
+ sa .Column ("director_id" , sa .Integer (), nullable = False ),
39
39
sa .ForeignKeyConstraint (
40
40
["director_id" ],
41
41
["directors.id" ],
0 commit comments