-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path2024_06_05_1755-369367fef20e_updated_franchise_model.py
48 lines (41 loc) · 2.08 KB
/
2024_06_05_1755-369367fef20e_updated_franchise_model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""Updated franchise model
Revision ID: 369367fef20e
Revises: 669174c7334c
Create Date: 2024-06-05 17:55:44.414314
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '369367fef20e'
down_revision = '669174c7334c'
branch_labels = None
depends_on = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('service_content_franchises',
sa.Column('scored_by', sa.Integer(), nullable=False),
sa.Column('score', sa.Float(), nullable=False),
sa.Column('id', sa.Uuid(), nullable=False),
sa.Column('content_id', sa.String(length=36), nullable=False),
sa.Column('updated', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_service_content_franchises_content_id'), 'service_content_franchises', ['content_id'], unique=True)
op.drop_index('ix_service_content_anime_franchises_content_id', table_name='service_content_anime_franchises')
op.drop_table('service_content_anime_franchises')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('service_content_anime_franchises',
sa.Column('scored_by', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('score', sa.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False),
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('content_id', sa.VARCHAR(length=36), autoincrement=False, nullable=False),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='service_content_anime_franchises_pkey')
)
op.create_index('ix_service_content_anime_franchises_content_id', 'service_content_anime_franchises', ['content_id'], unique=True)
op.drop_index(op.f('ix_service_content_franchises_content_id'), table_name='service_content_franchises')
op.drop_table('service_content_franchises')
# ### end Alembic commands ###