smart_proxy: add asset domains concept
This commit is contained in:
parent
dfb4d66557
commit
d99cf88f38
6 changed files with 60 additions and 4 deletions
40
migrations/versions/c644bb20d0e3_add_asset_origins.py
Normal file
40
migrations/versions/c644bb20d0e3_add_asset_origins.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
"""add asset origins
|
||||
|
||||
Revision ID: c644bb20d0e3
|
||||
Revises: 133961a48525
|
||||
Create Date: 2022-05-25 15:21:16.221418
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c644bb20d0e3'
|
||||
down_revision = '133961a48525'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('origin', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('assets', sa.Boolean(), nullable=True))
|
||||
with op.batch_alter_table('origin', schema=None) as batch_op:
|
||||
batch_op.execute("UPDATE origin SET assets=false")
|
||||
batch_op.alter_column('assets',
|
||||
existing_type=sa.BOOLEAN(),
|
||||
nullable=False)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('origin', schema=None) as batch_op:
|
||||
batch_op.alter_column('smart',
|
||||
existing_type=sa.BOOLEAN(),
|
||||
nullable=True)
|
||||
batch_op.drop_column('assets')
|
||||
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue