Ver código fonte

refactor(migration/model): update column types for workflow schema (#10160)

tags/0.11.0
-LAN- 1 ano atrás
pai
commit
bf048b8d7c
Nenhuma conta vinculada ao e-mail do autor do commit

+ 1
- 3
api/migrations/versions/2024_11_01_0623-09a8d1878d9b_update_workflows_graph_features_and_.py Ver arquivo

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(),
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(),
type_=sa.TEXT(),
existing_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(),

+ 3
- 2
api/models/workflow.py Ver arquivo

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


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)
_features: Mapped[str] = mapped_column("features")
graph: Mapped[str] = mapped_column(sa.Text)
_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)")

Carregando…
Cancelar
Salvar