fix data base
This commit is contained in:
17
bd/tables/organization.py
Normal file
17
bd/tables/organization.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from sqlalchemy import Column, String, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from .simple_base import Base
|
||||
import uuid
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class Organization(Base):
|
||||
__tablename__ = "organization"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
name_organization = Column(String(150), nullable=False)
|
||||
group_id = Column(UUID(as_uuid=True), ForeignKey("group.id", ondelete="CASCADE"), nullable=False)
|
||||
|
||||
group = relationship("Group", backref="organizations", passive_deletes=True)
|
||||
|
||||
__all__ = ["Base", "Organization"]
|
||||
|
||||
Reference in New Issue
Block a user