mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
2dff8b9a00
* Apply black formatting * Add auto formatting when committing to master * Update CONTRIBUTING.md re. Black & Prettier
27 lines
537 B
Python
27 lines
537 B
Python
"""favorites_unique_constraint
|
|
|
|
Revision ID: 71477dadd6ef
|
|
Revises: 0f740a081d20
|
|
Create Date: 2018-07-11 12:49:52.792123
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "71477dadd6ef"
|
|
down_revision = "0f740a081d20"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
op.create_unique_constraint(
|
|
"unique_favorite", "favorites", ["object_type", "object_id", "user_id"]
|
|
)
|
|
|
|
|
|
def downgrade():
|
|
op.drop_constraint("unique_favorite", "favorites", type_="unique")
|