-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
33 lines (26 loc) · 963 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy.dialects.postgresql import UUID,ARRAY
from sqlalchemy_utils import database_exists
from sqlalchemy_utils import UUIDType
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from database import Base
from sqlalchemy_utils import UUIDType
import uuid
# from uuid import UUID
# Create SQLAlchemy models from the Base class
class User(Base):
__tablename__ = "users"
# Create model attributes/columns
id = Column(Integer, primary_key=True, index=True)
username = Column(String)
email = Column(String, unique=True, index=True)
password = Column(String)
place=Column(String)
class review(Base):
__tablename__ ="review_table"
id = Column(UUID(as_uuid=True), primary_key=True, default =uuid.uuid4)
url=Column(String)
username = Column(String)
data = Column(String)
status = Column(Integer)