utp_service/backend/app/models/snapshot_policy.py
2026-05-28 17:02:12 +03:00

16 lines
773 B
Python

from sqlalchemy import Boolean, Integer, String
from sqlalchemy.dialects.postgresql import ARRAY, JSONB
from sqlalchemy.orm import Mapped, mapped_column
from .base import Base, TimestampMixin
class SnapshotPolicy(Base, TimestampMixin):
__tablename__ = "snapshot_policies"
id: Mapped[int] = mapped_column(Integer(), autoincrement=True, primary_key=True)
categories: Mapped[list[str]] = mapped_column(ARRAY(String(50)), nullable=False)
action_type: Mapped[str] = mapped_column(String(100), nullable=False)
params: Mapped[dict] = mapped_column(JSONB(), nullable=False, server_default="{}")
label: Mapped[str] = mapped_column(String(255), nullable=False)
is_active: Mapped[bool] = mapped_column(Boolean(), nullable=False, server_default="true")