-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from mistercrunch/dash_slug
Adding url slug support for dashboard model
- Loading branch information
Showing
3 changed files
with
42 additions
and
10 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
panoramix/migrations/versions/1a48a5411020_adding_slug_to_dash.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,23 @@ | ||
"""adding slug to dash | ||
Revision ID: 1a48a5411020 | ||
Revises: 289ce07647b | ||
Create Date: 2015-12-04 09:42:16.973264 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1a48a5411020' | ||
down_revision = '289ce07647b' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
def upgrade(): | ||
op.add_column('dashboards', sa.Column('slug', sa.String(length=255), nullable=True)) | ||
op.create_unique_constraint(None, 'dashboards', ['slug']) | ||
|
||
|
||
def downgrade(): | ||
op.drop_constraint(None, 'dashboards', type_='unique') | ||
op.drop_column('dashboards', 'slug') |
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
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