"""kworb_apple_music Revision ID: d95b2478c7e3 Revises: 2c22026359c5 Create Date: 2021-02-12 09:42:39.078450 """ # revision identifiers, used by Alembic. revision = 'd95b2478c7e3' down_revision = '2c22026359c5' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): op.execute(''' create table kworb_apple_music_charts ( country_code varchar(2) not null, as_of date not null, position integer not null, title varchar not null, position_change integer ) partition by range(as_of); create table kworb_apple_music_charts_default partition of kworb_apple_music_charts default; create unique index on kworb_apple_music_charts_default (as_of, country_code, position); ''') # ### end Alembic commands ### def downgrade(): op.drop_table('kworb_apple_music_charts') # ### end Alembic commands ###