"""yt_artist_channel Revision ID: 8b0d414a1798 Revises: cca7a93560b5 Create Date: 2019-02-05 22:14:41.232253 """ # revision identifiers, used by Alembic. revision = '8b0d414a1798' down_revision = 'cca7a93560b5' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('yt_artist_channels', sa.Column('ytid', sa.String(), nullable=False), sa.Column('name', sa.String(), nullable=True), sa.Column('first_seen', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False), sa.Column('last_updated', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False), sa.Column('data', postgresql.JSONB(none_as_null=True), nullable=True), sa.PrimaryKeyConstraint('ytid') ) op.create_table('yt_artist_channel_stats', sa.Column('artist_channel_ytid', sa.String(), nullable=False), sa.Column('as_of', sa.Date(), nullable=False), sa.Column('subscriber_count', sa.Integer(), autoincrement=False, nullable=False), sa.Column('view_count', sa.Integer(), autoincrement=False, nullable=False), sa.Column('comment_count', sa.Integer(), autoincrement=False, nullable=False), sa.Column('video_count', sa.Integer(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['artist_channel_ytid'], ['yt_artist_channels.ytid'], ), sa.PrimaryKeyConstraint('artist_channel_ytid', 'as_of') ) ### end Alembic commands ### def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.drop_table('yt_artist_channel_stats') op.drop_table('yt_artist_channels') ### end Alembic commands ###