rebase
This commit is contained in:
@@ -91,8 +91,11 @@ class WorldPreset(Base):
|
||||
id: Mapped[uuid.UUID] = mapped_column(
|
||||
PG_UUID(as_uuid=True), primary_key=True, default=uuid.uuid4
|
||||
)
|
||||
owner_id: Mapped[uuid.UUID] = mapped_column(
|
||||
PG_UUID(as_uuid=True), ForeignKey("users.id", ondelete="CASCADE"), nullable=False
|
||||
# owner_id is nullable so that builtin/system presets can exist without
|
||||
# a real user owning them. Custom presets created via the admin UI get
|
||||
# the admin's user_id.
|
||||
owner_id: Mapped[uuid.UUID | None] = mapped_column(
|
||||
PG_UUID(as_uuid=True), ForeignKey("users.id", ondelete="SET NULL"), nullable=True
|
||||
)
|
||||
name: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
description: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
@@ -112,7 +115,7 @@ class WorldPreset(Base):
|
||||
DateTime(timezone=True), nullable=False, default=_now, onupdate=_now
|
||||
)
|
||||
|
||||
owner: Mapped[User] = relationship(back_populates="presets")
|
||||
owner: Mapped[User | None] = relationship(back_populates="presets")
|
||||
worlds: Mapped[list["World"]] = relationship(back_populates="preset")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user