30b0101584
This attempts to insert a temporary entry into each enum table until it succeeds. It re-synchronizes the postgres sequence generators with the max id of the table. Fixes #883 and #880
28 lines
564 B
Python
28 lines
564 B
Python
"""add US West location
|
|
|
|
Revision ID: 82297d834ad
|
|
Revises: 47670cbeced
|
|
Create Date: 2014-08-15 13:35:23.834079
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '82297d834ad'
|
|
down_revision = '47670cbeced'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
def upgrade(tables):
|
|
op.bulk_insert(tables.imagestoragelocation,
|
|
[
|
|
{'name':'s3_us_west_1'},
|
|
])
|
|
|
|
|
|
def downgrade(tables):
|
|
op.execute(
|
|
(tables.imagestoragelocation.delete()
|
|
.where(tables.imagestoragelocation.c.name == op.inline_literal('s3_us_west_1')))
|
|
|
|
)
|