mirror of
https://github.com/a-mayb3/Kanban_clone_backend.git
synced 2026-03-21 10:05:38 +01:00
Started implementing auth
This commit is contained in:
parent
e557c25789
commit
b909a23fa3
7 changed files with 279 additions and 19 deletions
11
models.py
11
models.py
|
|
@ -1,6 +1,6 @@
|
|||
from sqlalchemy import Column, ForeignKey, String, Integer, Table
|
||||
from sqlalchemy.orm import relationship
|
||||
from sqlalchemy.dialects.sqlite import BLOB
|
||||
from sqlalchemy.orm import relationship
|
||||
from database import Base
|
||||
from typing import Optional, List
|
||||
|
||||
|
|
@ -14,16 +14,17 @@ project_user = Table(
|
|||
class User(Base):
|
||||
__tablename__ = "users"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||
name = Column(String, index=True)
|
||||
email = Column(String, unique=True, index=True)
|
||||
password_hash = Column(BLOB)
|
||||
password_hash = Column(String)
|
||||
password_salt = Column(String)
|
||||
projects = relationship("Project", secondary=project_user, back_populates="users")
|
||||
|
||||
class Project(Base):
|
||||
__tablename__ = "projects"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||
name = Column(String, index=True)
|
||||
description = Column(String)
|
||||
users = relationship("User", secondary=project_user, back_populates="projects")
|
||||
|
|
@ -32,7 +33,7 @@ class Project(Base):
|
|||
class Task(Base):
|
||||
__tablename__ = "tasks"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
||||
title = Column(String, index=True)
|
||||
description = Column(String)
|
||||
status = Column(String, default="pending")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue