"""page_id -> id

Revision ID: c1e09fa839a0
Revises: 7<PASSWORD>
Create Date: 2021-02-10 11:49:15.727334

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'c1e09fa839a0'
down_revision = '73be66301ee8'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('page_metadata', sa.Column('id', postgresql.UUID(), nullable=False))
    op.drop_constraint('page_metadata_page_id_key', 'page_metadata', type_='unique')
    op.create_unique_constraint(None, 'page_metadata', ['id'])
    # op.drop_constraint('page_metadata_page_id_fkey', 'page_metadata', type_='foreignkey')
    op.create_foreign_key(None, 'page_metadata', 'pages', ['id'], ['id'])
    op.drop_column('page_metadata', 'page_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('page_metadata', sa.Column('page_id', postgresql.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'page_metadata', type_='foreignkey')
    op.create_foreign_key('page_metadata_page_id_fkey', 'page_metadata', 'pages', ['page_id'], ['id'])
    op.drop_constraint(None, 'page_metadata', type_='unique')
    op.create_unique_constraint('page_metadata_page_id_key', 'page_metadata', ['page_id'])
    op.drop_column('page_metadata', 'id')
    # ### end Alembic commands ###

"""page_id -> id

Revision ID: c1e09fa839a0
Revises: 7<PASSWORD>
Create Date: 2021-02-10 11:49:15.727334

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'c1e09fa839a0'
down_revision = '73be66301ee8'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('page_metadata', sa.Column('id', postgresql.UUID(), nullable=False))
    op.drop_constraint('page_metadata_page_id_key', 'page_metadata', type_='unique')
    op.create_unique_constraint(None, 'page_metadata', ['id'])
    # op.drop_constraint('page_metadata_page_id_fkey', 'page_metadata', type_='foreignkey')
    op.create_foreign_key(None, 'page_metadata', 'pages', ['id'], ['id'])
    op.drop_column('page_metadata', 'page_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('page_metadata', sa.Column('page_id', postgresql.UUID(), autoincrement=False, nullable=False))
    op.drop_constraint(None, 'page_metadata', type_='foreignkey')
    op.create_foreign_key('page_metadata_page_id_fkey', 'page_metadata', 'pages', ['page_id'], ['id'])
    op.drop_constraint(None, 'page_metadata', type_='unique')
    op.create_unique_constraint('page_metadata_page_id_key', 'page_metadata', ['page_id'])
    op.drop_column('page_metadata', 'id')
    # ### end Alembic commands ###

page_id -> id  Revision ID: c1e09fa839a0 Revises: 7<PASSWORD> Create Date: 2021-02-10 11:49:15.727334 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # op.drop_constraint('page_metadata_page_id_fkey', 'page_metadata', type_='foreignkey') # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###