mirror of https://github.com/langgenius/dify.git
modify migrations
This commit is contained in:
parent
ea883b5e48
commit
fee8a86880
|
|
@ -0,0 +1,48 @@
|
|||
"""conversation columns set nullable
|
||||
|
||||
Revision ID: 42e85ed5564d
|
||||
Revises: f9107f83abab
|
||||
Create Date: 2024-03-07 08:30:29.133614
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '42e85ed5564d'
|
||||
down_revision = 'f9107f83abab'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('conversations', schema=None) as batch_op:
|
||||
batch_op.alter_column('app_model_config_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=True)
|
||||
batch_op.alter_column('model_provider',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=True)
|
||||
batch_op.alter_column('model_id',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=True)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('conversations', schema=None) as batch_op:
|
||||
batch_op.alter_column('model_id',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=False)
|
||||
batch_op.alter_column('model_provider',
|
||||
existing_type=sa.VARCHAR(length=255),
|
||||
nullable=False)
|
||||
batch_op.alter_column('app_model_config_id',
|
||||
existing_type=postgresql.UUID(),
|
||||
nullable=False)
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
|
@ -78,8 +78,6 @@ def upgrade():
|
|||
sa.Column('error', sa.Text(), nullable=True),
|
||||
sa.Column('elapsed_time', sa.Float(), server_default=sa.text('0'), nullable=False),
|
||||
sa.Column('total_tokens', sa.Integer(), server_default=sa.text('0'), nullable=False),
|
||||
sa.Column('total_price', sa.Numeric(precision=10, scale=7), nullable=True),
|
||||
sa.Column('currency', sa.String(length=255), nullable=True),
|
||||
sa.Column('total_steps', sa.Integer(), server_default=sa.text('0'), nullable=True),
|
||||
sa.Column('created_by_role', sa.String(length=255), nullable=False),
|
||||
sa.Column('created_by', postgresql.UUID(), nullable=False),
|
||||
|
|
|
|||
Loading…
Reference in New Issue