Adicionar organizacao.py
This commit is contained in:
commit
8a6314987d
11
organizacao.py
Normal file
11
organizacao.py
Normal file
@ -0,0 +1,11 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, func
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
class Organizacao(Base):
|
||||
__tablename__ = 'organizacoes'
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True, unique=True)
|
||||
nome = Column(String, nullable=False, unique=True)
|
||||
criado_em = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
|
||||
|
||||
usuarios = relationship('User', back_populates='organizacao')
|
||||
Loading…
Reference in New Issue
Block a user