mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-08 08:33:45 +01:00
Add migration
This commit is contained in:
parent
746cf7f4b5
commit
92daa87db0
39
migrations/versions/4e482c47e519_.py
Normal file
39
migrations/versions/4e482c47e519_.py
Normal file
@ -0,0 +1,39 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 4e482c47e519
|
||||
Revises: 900758871713
|
||||
Create Date: 2018-05-27 22:38:16.507155
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4e482c47e519'
|
||||
down_revision = '900758871713'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('dependency',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('depender_id', sa.Integer(), nullable=True),
|
||||
sa.Column('package_id', sa.Integer(), nullable=True),
|
||||
sa.Column('meta_package_id', sa.Integer(), nullable=True),
|
||||
sa.Column('optional', sa.Boolean(), nullable=False),
|
||||
sa.ForeignKeyConstraint(['depender_id'], ['package.id'], ),
|
||||
sa.ForeignKeyConstraint(['meta_package_id'], ['meta_package.id'], ),
|
||||
sa.ForeignKeyConstraint(['package_id'], ['package.id'], ),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('depender_id', 'package_id', 'meta_package_id', name='_dependency_uc')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('dependency')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue
Block a user