Skip to content

Commit

Permalink
[bugfix] sqlite ALTER issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Dec 12, 2015
1 parent 65c1c42 commit 18a2670
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@

def upgrade():
op.add_column('dashboards', sa.Column('slug', sa.String(length=255), nullable=True))
op.create_unique_constraint('idx_unique_slug', 'dashboards', ['slug'])
try:
op.create_unique_constraint('idx_unique_slug', 'dashboards', ['slug'])
except:
pass


def downgrade():
Expand Down
16 changes: 8 additions & 8 deletions panoramix/migrations/versions/315b3f4da9b0_adding_log_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
from alembic import op
import sqlalchemy as sa


def upgrade():
op.create_table('logs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('action', sa.String(length=512), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('json', sa.Text(), nullable=True),
sa.Column('dttm', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['ab_user.id'], ),
sa.PrimaryKeyConstraint('id')
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('action', sa.String(length=512), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=True),
sa.Column('json', sa.Text(), nullable=True),
sa.Column('dttm', sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(['user_id'], ['ab_user.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.drop_table('birth_names')


def downgrade():
Expand Down

0 comments on commit 18a2670

Please sign in to comment.