-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing unique constraint in SqlaTable model (#360)
- Loading branch information
1 parent
2d420ee
commit 01c2c7b
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
caravel/migrations/versions/b4456560d4f3_change_table_unique_constraint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""change_table_unique_constraint | ||
Revision ID: b4456560d4f3 | ||
Revises: bb51420eaf83 | ||
Create Date: 2016-04-15 08:31:26.249591 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'b4456560d4f3' | ||
down_revision = 'bb51420eaf83' | ||
|
||
from alembic import op | ||
|
||
|
||
def upgrade(): | ||
op.drop_constraint( | ||
u'tables_table_name_key', 'tables', type_='unique') | ||
op.create_unique_constraint( | ||
u'_customer_location_uc', 'tables', | ||
['database_id', 'schema', 'table_name']) | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint(u'_customer_location_uc', 'tables', type_='unique') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters