36 lines
796 B
Python
36 lines
796 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
|
|
from sqlalchemy.dialects import mysql
|
|
from data.model.sqlalchemybridge import gen_sqlalchemy_metadata
|
|
from data.database import all_models
|
|
|
|
|
|
def upgrade():
|
|
schema = gen_sqlalchemy_metadata(all_models)
|
|
|
|
op.bulk_insert(schema.tables['imagestoragelocation'],
|
|
[
|
|
{'id':8, 'name':'s3_us_west_1'},
|
|
])
|
|
|
|
|
|
def downgrade():
|
|
schema = gen_sqlalchemy_metadata(all_models)
|
|
|
|
op.execute(
|
|
(imagestoragelocation.delete()
|
|
.where(imagestoragelocation.c.name == op.inline_literal('s3_us_west_1')))
|
|
|
|
)
|