Spaces:
Running
Running
Delete entity
Browse files
entity/Database_Entity.py
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
from sqlalchemy import Column, String, Text, DateTime, Integer, ForeignKey, TIMESTAMP
|
2 |
-
from sqlalchemy.orm import relationship
|
3 |
-
from sqlalchemy.orm import DeclarativeBase
|
4 |
-
from sqlalchemy.sql import func
|
5 |
-
class Base(DeclarativeBase):
|
6 |
-
pass
|
7 |
-
|
8 |
-
class User(Base):
|
9 |
-
__tablename__ = 'users'
|
10 |
-
id = Column(Integer, primary_key=True, autoincrement=True)
|
11 |
-
email = Column(String(255))
|
12 |
-
access_token = Column(Text)
|
13 |
-
refresh_token = Column(Text)
|
14 |
-
expires_at = Column(DateTime)
|
15 |
-
|
16 |
-
chat_histories = relationship("ChatHistory", back_populates="user")
|
17 |
-
user_logins = relationship("UserLogin", back_populates="user")
|
18 |
-
user_infos = relationship("UserInfo", back_populates="user")
|
19 |
-
|
20 |
-
class ChatHistory(Base):
|
21 |
-
__tablename__ = 'chat_history'
|
22 |
-
|
23 |
-
id = Column(Integer, primary_key=True,autoincrement=True)
|
24 |
-
email = Column(String(255), ForeignKey('users.email'))
|
25 |
-
name_chat = Column(String(255), unique=True)
|
26 |
-
|
27 |
-
user = relationship("User", back_populates="chat_histories")
|
28 |
-
detail_chats = relationship("DetailChat", back_populates="chat_history")
|
29 |
-
|
30 |
-
class UserLogin(Base):
|
31 |
-
__tablename__ = 'user_login'
|
32 |
-
|
33 |
-
id = Column(Integer, primary_key=True,autoincrement=True)
|
34 |
-
user_email = Column(String(100), ForeignKey('users.email'), primary_key=True)
|
35 |
-
user_session_id = Column(String(100), primary_key=True)
|
36 |
-
|
37 |
-
user = relationship("User", back_populates="user_logins")
|
38 |
-
|
39 |
-
class UserInfo(Base):
|
40 |
-
__tablename__ = 'user_info'
|
41 |
-
|
42 |
-
id = Column(Integer, primary_key=True, autoincrement=True)
|
43 |
-
uid = Column(Text)
|
44 |
-
email = Column(String(255), ForeignKey('users.email'), unique=True)
|
45 |
-
display_name = Column(Text)
|
46 |
-
photo_url = Column(Text)
|
47 |
-
|
48 |
-
user = relationship("User", back_populates="user_infos")
|
49 |
-
|
50 |
-
class DetailChat(Base):
|
51 |
-
__tablename__ = 'detail_chat'
|
52 |
-
|
53 |
-
id = Column(Integer, primary_key=True, autoincrement=True)
|
54 |
-
chat_id = Column(Integer, ForeignKey('chat_history.id'))
|
55 |
-
YouMessage = Column(Text)
|
56 |
-
AiMessage = Column(Text)
|
57 |
-
data_relevant = Column(Text)
|
58 |
-
source_file = Column(Text)
|
59 |
-
|
60 |
-
chat_history = relationship("ChatHistory", back_populates="detail_chats")
|
61 |
-
|
62 |
-
class OTP(Base):
|
63 |
-
__tablename__ = 'otp'
|
64 |
-
|
65 |
-
id = Column(Integer, primary_key=True, autoincrement=True)
|
66 |
-
email = Column(String(255), nullable=False)
|
67 |
-
otp = Column(String(6), nullable=False)
|
68 |
-
created_at = Column(TIMESTAMP, server_default=func.now())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
entity/__pycache__/Database_Entity.cpython-310.pyc
DELETED
Binary file (2.8 kB)
|
|
entity/__pycache__/Database_Entity.cpython-311.pyc
DELETED
Binary file (4.77 kB)
|
|
entity/__pycache__/__init__.cpython-310.pyc
DELETED
Binary file (168 Bytes)
|
|