# Copyright (C) 2025 Raccoon Survey org
# This file is part of Raccoon Survey.
# Raccoon Survey is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License v3 as published by
# the Free Software Foundation.
# See the LICENSE file distributed with this program for details.
from __future__ import annotations
from src.core.database import db
[docs]
class Team(db.Model):
"""Team model.
Args:
db (SQLAlchemy): The SQLAlchemy database instance.
"""
__tablename__ = "teams"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
description = db.Column(db.Text)
state = db.Column(db.Boolean, default=True)
created_at = db.Column(db.DateTime, server_default=db.func.now())
users = db.relationship("User", back_populates="team")
surveys = db.relationship("Survey", back_populates="team")
survey_tokens = db.relationship("SurveyToken", back_populates="team")
__all__ = ["Team"]