mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
21 lines
688 B
Python
21 lines
688 B
Python
from typing import List
|
|
|
|
from sqlalchemy import Column, String
|
|
from sqlalchemy.orm import relationship
|
|
from fastapi_users.db import SQLAlchemyBaseUserTableUUID, SQLAlchemyBaseOAuthAccountTableUUID
|
|
from app.core.base import Base
|
|
|
|
|
|
class OAuthAccount(SQLAlchemyBaseOAuthAccountTableUUID, Base):
|
|
pass
|
|
|
|
|
|
class User(SQLAlchemyBaseUserTableUUID, Base):
|
|
first_name = Column(String(length=100), nullable=True)
|
|
last_name = Column(String(length=100), nullable=True)
|
|
oauth_accounts = relationship("OAuthAccount", lazy="joined")
|
|
|
|
# Relationship
|
|
transactions = relationship("Transaction", back_populates="user")
|
|
categories = relationship("Category", back_populates="user")
|