Add device_id to client db
This commit is contained in:
parent
9578883bbb
commit
09108f6a73
6 changed files with 47 additions and 10 deletions
|
@ -56,6 +56,7 @@ def run_migrations_offline():
|
|||
target_metadata=target_metadata,
|
||||
literal_binds=True,
|
||||
dialect_opts={"paramstyle": "named"},
|
||||
render_as_batch=True,
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
|
@ -77,7 +78,8 @@ def run_migrations_online():
|
|||
|
||||
with connectable.connect() as connection:
|
||||
context.configure(
|
||||
connection=connection, target_metadata=target_metadata
|
||||
connection=connection, target_metadata=target_metadata,
|
||||
render_as_batch=True,
|
||||
)
|
||||
|
||||
with context.begin_transaction():
|
||||
|
|
32
alembic/versions/4b93300852aa_add_device_id_to_clients.py
Normal file
32
alembic/versions/4b93300852aa_add_device_id_to_clients.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
"""Add device_id to clients
|
||||
|
||||
Revision ID: 4b93300852aa
|
||||
Revises: fccd1f95544d
|
||||
Create Date: 2020-07-11 15:49:38.831459
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '4b93300852aa'
|
||||
down_revision = 'fccd1f95544d'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('client', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('device_id', sa.String(length=255), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('client', schema=None) as batch_op:
|
||||
batch_op.drop_column('device_id')
|
||||
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue