Skip to content

Commit

Permalink
Remove foreign key on devices to dep_profile_id because SQLite did no…
Browse files Browse the repository at this point in the history
…t support ALTER of constraints
  • Loading branch information
mosen committed Jul 29, 2018
1 parent 3702e4d commit f49beb1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -49,12 +49,14 @@ def schema_upgrades():
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_dep_profiles_uuid'), 'dep_profiles', ['uuid'], unique=False)
# op.create_foreign_key(None, 'devices', 'dep_profiles', ['dep_profile_id'], ['id'])


def schema_downgrades():
"""schema downgrade migrations go here."""
op.drop_index(op.f('ix_dep_profiles_uuid'), table_name='dep_profiles')
op.drop_table('dep_profiles')
# op.drop_constraint(None, 'devices', type_='foreignkey')


def data_upgrades():
Expand Down
Expand Up @@ -47,11 +47,9 @@ def schema_upgrades():
op.add_column('devices', sa.Column('profile_push_time', sa.DateTime(), nullable=True))
op.add_column('devices', sa.Column('profile_status', sa.String(), nullable=True))
op.add_column('devices', sa.Column('profile_uuid', sa.String(), nullable=True))
op.create_foreign_key(None, 'devices', 'dep_profiles', ['dep_profile_id'], ['id'])


def schema_downgrades():
op.drop_constraint(None, 'devices', type_='foreignkey')
op.drop_column('devices', 'profile_uuid')
op.drop_column('devices', 'profile_status')
op.drop_column('devices', 'profile_push_time')
Expand Down

0 comments on commit f49beb1

Please sign in to comment.