Adds updated_at and folder cols to flow table

This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-11-21 21:00:22 -03:00
commit cb000dd248

View file

@ -7,10 +7,9 @@ Create Date: 2023-11-21 20:56:53.998781
""" """
from typing import Sequence, Union from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
import sqlmodel import sqlmodel
from alembic import op
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision: str = '7d2162acc8b2' revision: str = '7d2162acc8b2'
@ -41,15 +40,24 @@ def upgrade() -> None:
def downgrade() -> None: def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
try:
with op.batch_alter_table('flow', schema=None) as batch_op: with op.batch_alter_table('flow', schema=None) as batch_op:
batch_op.drop_column('folder') batch_op.drop_column('folder')
batch_op.drop_column('updated_at') batch_op.drop_column('updated_at')
except Exception as e:
print(e)
pass
try:
with op.batch_alter_table('apikey', schema=None) as batch_op: with op.batch_alter_table('apikey', schema=None) as batch_op:
batch_op.alter_column('name', batch_op.alter_column('name',
existing_type=sa.VARCHAR(), existing_type=sa.VARCHAR(),
nullable=True) nullable=True)
except Exception as e:
print(e)
pass
try:
op.create_table('flowstyle', op.create_table('flowstyle',
sa.Column('color', sa.VARCHAR(), nullable=False), sa.Column('color', sa.VARCHAR(), nullable=False),
sa.Column('emoji', sa.VARCHAR(), nullable=False), sa.Column('emoji', sa.VARCHAR(), nullable=False),
@ -72,8 +80,11 @@ def downgrade() -> None:
sa.Column('update_at', sa.DATETIME(), nullable=False), sa.Column('update_at', sa.DATETIME(), nullable=False),
sa.PrimaryKeyConstraint('id') sa.PrimaryKeyConstraint('id')
) )
with op.batch_alter_table('component', schema=None) as batch_op: with op.batch_alter_table('component', schema=None) as batch_op:
batch_op.create_index('ix_component_name', ['name'], unique=False) batch_op.create_index('ix_component_name', ['name'], unique=False)
batch_op.create_index('ix_component_frontend_node_id', ['frontend_node_id'], unique=False) batch_op.create_index('ix_component_frontend_node_id', ['frontend_node_id'], unique=False)
except Exception as e:
print(e)
pass
# ### end Alembic commands ### # ### end Alembic commands ###