def upgrade():
op.create_table('artists',
sa.Column('id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column('name', sa.String(), nullable=True),
sa.Column('description', sa.String(), nullable=True),
sa.Column('search_vector', sqlalchemy_utils.types.ts_vector.TSVectorType(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('torrents',
sa.Column('id', sa.String(length=40), nullable=False),
sa.Column('info', sa.PickleType(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_table('albums',
sa.Column('id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
sa.Column('title', sa.String(), nullable=True),
sa.Column('tracks', sqlalchemy_utils.types.json.JSONType(), nullable=True),
sa.Column('search_vector', sqlalchemy_utils.types.ts_vector.TSVectorType(), nullable=True),
sa.Column('torrent_id', sa.String(length=40), nullable=True),
sa.Column('artist_id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=True),
sa.ForeignKeyConstraint(['artist_id'], ['artists.id'], ),
sa.ForeignKeyConstraint(['torrent_id'], ['torrents.id'], ),
sa.PrimaryKeyConstraint('id')
)
评论列表
文章目录