feat: Asset Catalog system, PostGIS integration and RobotScout V1
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import enum
|
||||
import uuid
|
||||
from sqlalchemy import Column, Integer, String, Boolean, DateTime, ForeignKey, JSON, text
|
||||
from sqlalchemy.dialects.postgresql import ENUM as PG_ENUM
|
||||
from sqlalchemy.orm import relationship
|
||||
@@ -25,6 +24,9 @@ class Organization(Base):
|
||||
full_name = Column(String, nullable=False)
|
||||
name = Column(String, nullable=False)
|
||||
display_name = Column(String(50))
|
||||
|
||||
# --- BIZTONSÁGI BŐVÍTÉS (Mappa elszigetelés) ---
|
||||
folder_slug = Column(String(12), unique=True, index=True)
|
||||
|
||||
default_currency = Column(String(3), default="HUF")
|
||||
country_code = Column(String(2), default="HU")
|
||||
@@ -63,7 +65,7 @@ class Organization(Base):
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# String alapú hivatkozás a körkörös import ellen
|
||||
# Kapcsolatok
|
||||
assets = relationship("AssetAssignment", back_populates="organization", cascade="all, delete-orphan")
|
||||
members = relationship("OrganizationMember", back_populates="organization", cascade="all, delete-orphan")
|
||||
owner = relationship("User", back_populates="owned_organizations")
|
||||
@@ -75,8 +77,7 @@ class OrganizationMember(Base):
|
||||
organization_id = Column(Integer, ForeignKey("data.organizations.id"), nullable=False)
|
||||
user_id = Column(Integer, ForeignKey("data.users.id"), nullable=False)
|
||||
role = Column(String, default="driver")
|
||||
|
||||
permissions = Column(JSON, server_default=text("'{}'::jsonb"))
|
||||
|
||||
organization = relationship("Organization", back_populates="members")
|
||||
user = relationship("User") # Egyszerűsített string hivatkozás
|
||||
user = relationship("User")
|
||||
Reference in New Issue
Block a user