mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-03 11:48:08 +08:00
refactor(migration/model): update column types for workflow schema (#10160)
This commit is contained in:
parent
9ac2bb30f4
commit
bf048b8d7c
@ -39,7 +39,6 @@ def upgrade():
|
|||||||
nullable=False)
|
nullable=False)
|
||||||
batch_op.alter_column('features',
|
batch_op.alter_column('features',
|
||||||
existing_type=sa.TEXT(),
|
existing_type=sa.TEXT(),
|
||||||
type_=sa.String(),
|
|
||||||
nullable=False)
|
nullable=False)
|
||||||
batch_op.alter_column('updated_at',
|
batch_op.alter_column('updated_at',
|
||||||
existing_type=postgresql.TIMESTAMP(),
|
existing_type=postgresql.TIMESTAMP(),
|
||||||
@ -55,8 +54,7 @@ def downgrade():
|
|||||||
existing_type=postgresql.TIMESTAMP(),
|
existing_type=postgresql.TIMESTAMP(),
|
||||||
nullable=True)
|
nullable=True)
|
||||||
batch_op.alter_column('features',
|
batch_op.alter_column('features',
|
||||||
existing_type=sa.String(),
|
existing_type=sa.TEXT(),
|
||||||
type_=sa.TEXT(),
|
|
||||||
nullable=True)
|
nullable=True)
|
||||||
batch_op.alter_column('graph',
|
batch_op.alter_column('graph',
|
||||||
existing_type=sa.TEXT(),
|
existing_type=sa.TEXT(),
|
||||||
|
@ -4,6 +4,7 @@ from datetime import datetime
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
from typing import Any, Optional, Union
|
from typing import Any, Optional, Union
|
||||||
|
|
||||||
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import func
|
from sqlalchemy import func
|
||||||
from sqlalchemy.orm import Mapped, mapped_column
|
from sqlalchemy.orm import Mapped, mapped_column
|
||||||
|
|
||||||
@ -99,8 +100,8 @@ class Workflow(db.Model):
|
|||||||
app_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
|
app_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
|
||||||
type: Mapped[str] = mapped_column(db.String(255), nullable=False)
|
type: Mapped[str] = mapped_column(db.String(255), nullable=False)
|
||||||
version: Mapped[str] = mapped_column(db.String(255), nullable=False)
|
version: Mapped[str] = mapped_column(db.String(255), nullable=False)
|
||||||
graph: Mapped[str] = mapped_column(db.Text)
|
graph: Mapped[str] = mapped_column(sa.Text)
|
||||||
_features: Mapped[str] = mapped_column("features")
|
_features: Mapped[str] = mapped_column("features", sa.TEXT)
|
||||||
created_by: Mapped[str] = mapped_column(StringUUID, nullable=False)
|
created_by: Mapped[str] = mapped_column(StringUUID, nullable=False)
|
||||||
created_at: Mapped[datetime] = mapped_column(
|
created_at: Mapped[datetime] = mapped_column(
|
||||||
db.DateTime, nullable=False, server_default=db.text("CURRENT_TIMESTAMP(0)")
|
db.DateTime, nullable=False, server_default=db.text("CURRENT_TIMESTAMP(0)")
|
||||||
|
Loading…
Reference in New Issue
Block a user