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,39 +40,51 @@ def upgrade() -> None:
def downgrade() -> None: def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ### # ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('flow', schema=None) as batch_op: try:
batch_op.drop_column('folder') with op.batch_alter_table('flow', schema=None) as batch_op:
batch_op.drop_column('updated_at') batch_op.drop_column('folder')
batch_op.drop_column('updated_at')
except Exception as e:
print(e)
pass
with op.batch_alter_table('apikey', schema=None) as batch_op: try:
batch_op.alter_column('name',
existing_type=sa.VARCHAR(),
nullable=True)
op.create_table('flowstyle', with op.batch_alter_table('apikey', schema=None) as batch_op:
sa.Column('color', sa.VARCHAR(), nullable=False), batch_op.alter_column('name',
sa.Column('emoji', sa.VARCHAR(), nullable=False), existing_type=sa.VARCHAR(),
sa.Column('flow_id', sa.CHAR(length=32), nullable=True), nullable=True)
sa.Column('id', sa.CHAR(length=32), nullable=False), except Exception as e:
sa.ForeignKeyConstraint(['flow_id'], ['flow.id'], ), print(e)
sa.PrimaryKeyConstraint('id'), pass
sa.UniqueConstraint('id') try:
) op.create_table('flowstyle',
op.create_table('component', sa.Column('color', sa.VARCHAR(), nullable=False),
sa.Column('id', sa.CHAR(length=32), nullable=False), sa.Column('emoji', sa.VARCHAR(), nullable=False),
sa.Column('frontend_node_id', sa.CHAR(length=32), nullable=False), sa.Column('flow_id', sa.CHAR(length=32), nullable=True),
sa.Column('name', sa.VARCHAR(), nullable=False), sa.Column('id', sa.CHAR(length=32), nullable=False),
sa.Column('description', sa.VARCHAR(), nullable=True), sa.ForeignKeyConstraint(['flow_id'], ['flow.id'], ),
sa.Column('python_code', sa.VARCHAR(), nullable=True), sa.PrimaryKeyConstraint('id'),
sa.Column('return_type', sa.VARCHAR(), nullable=True), sa.UniqueConstraint('id')
sa.Column('is_disabled', sa.BOOLEAN(), nullable=False), )
sa.Column('is_read_only', sa.BOOLEAN(), nullable=False), op.create_table('component',
sa.Column('create_at', sa.DATETIME(), nullable=False), sa.Column('id', sa.CHAR(length=32), nullable=False),
sa.Column('update_at', sa.DATETIME(), nullable=False), sa.Column('frontend_node_id', sa.CHAR(length=32), nullable=False),
sa.PrimaryKeyConstraint('id') sa.Column('name', sa.VARCHAR(), nullable=False),
) sa.Column('description', sa.VARCHAR(), nullable=True),
with op.batch_alter_table('component', schema=None) as batch_op: sa.Column('python_code', sa.VARCHAR(), nullable=True),
batch_op.create_index('ix_component_name', ['name'], unique=False) sa.Column('return_type', sa.VARCHAR(), nullable=True),
batch_op.create_index('ix_component_frontend_node_id', ['frontend_node_id'], unique=False) sa.Column('is_disabled', sa.BOOLEAN(), nullable=False),
sa.Column('is_read_only', sa.BOOLEAN(), nullable=False),
sa.Column('create_at', sa.DATETIME(), nullable=False),
sa.Column('update_at', sa.DATETIME(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
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_frontend_node_id', ['frontend_node_id'], unique=False)
except Exception as e:
print(e)
pass
# ### end Alembic commands ### # ### end Alembic commands ###