contentdb/migrations/versions/7def3e843d04_.py
2019-01-28 20:48:07 +00:00

42 lines
1.5 KiB
Python

"""empty message
Revision ID: 7def3e843d04
Revises: dce69ad1e4eb
Create Date: 2019-01-28 20:27:33.760232
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '7def3e843d04'
down_revision = 'dce69ad1e4eb'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('minetest_release',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(length=100), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
)
op.add_column('package_release', sa.Column('max_rel_id', sa.Integer(), nullable=True, server_default=None))
op.add_column('package_release', sa.Column('min_rel_id', sa.Integer(), nullable=True, server_default=None))
op.create_foreign_key(None, 'package_release', 'minetest_release', ['max_rel_id'], ['id'])
op.create_foreign_key(None, 'package_release', 'minetest_release', ['min_rel_id'], ['id'])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'package_release', type_='foreignkey')
op.drop_constraint(None, 'package_release', type_='foreignkey')
op.drop_column('package_release', 'min_rel_id')
op.drop_column('package_release', 'max_rel_id')
op.drop_table('minetest_release')
# ### end Alembic commands ###