tasks_manager/backend/models.py

23 lines
815 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from sqlalchemy import Column, Integer, String
from .database import Base
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True, index=True)
phone_number = Column(String, unique=True, index=True)
first_name = Column(String)
last_name = Column(String)
middle_name = Column(String)
address = Column(String)
email = Column(String, unique=True)
password = Column(String)
class Task(Base):
__tablename__ = "tasks"
id = Column(Integer, primary_key=True, index=True)
title = Column(String)
description = Column(String)
status = Column(String) # Например, "В ожидании", "На рассмотрении", "Завершено"
user_id = Column(Integer) # ID пользователя, создавшего задачу