init: new structure + fix lint errors
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import ForeignKey, String, Text
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from cpv3.db.base import Base, BaseModelMixin
|
||||
|
||||
|
||||
class Project(Base, BaseModelMixin):
|
||||
__tablename__ = "projects"
|
||||
|
||||
owner_id: Mapped[uuid.UUID] = mapped_column(
|
||||
UUID(as_uuid=True),
|
||||
ForeignKey("users.id", ondelete="RESTRICT"),
|
||||
index=True,
|
||||
)
|
||||
|
||||
name: Mapped[str] = mapped_column(String(255))
|
||||
description: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
language: Mapped[str] = mapped_column(String(4), default="auto")
|
||||
folder: Mapped[str | None] = mapped_column(String(1024), nullable=True)
|
||||
status: Mapped[str] = mapped_column(String(16), default="DRAFT")
|
||||
Reference in New Issue
Block a user