-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
95 lines (74 loc) · 2.76 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
from sqlalchemy.sql.expression import null
from sqlalchemy.sql.schema import ForeignKey
from database import Base
from sqlalchemy import Column, Integer, String, Float, Boolean
from sqlalchemy import Sequence
from sqlalchemy.orm import relationship
from sqlalchemy.dialects import oracle
class User(Base):
__tablename__ = 'uinfo'
id_seq = Sequence('USER_ID_SEQ', metadata=Base.metadata, minvalue=1001000)
id = Column(Integer, Sequence('USER_ID_SEQ'), primary_key=True)
username = Column(String(100), nullable=False, unique=True)
password = Column(String(200), nullable=False)
email = Column(String(200), nullable=False, unique=True)
phonenumber = Column(String(100), nullable=False, unique=True)
birthday = Column(String(100))
agegroup = Column(Integer, ForeignKey('age.agegroup'))
height = Column(Integer)
weight = Column(Integer)
jeansize = Column(String(10))
class Preference(Base):
__tablename__ = 'preference'
userid = Column(Integer, ForeignKey('uinfo.id'), primary_key=True)
a_agegroup = Column(Integer, ForeignKey('age.agegroup'), primary_key=True)
trend = Column(Float)
agegroup = Column(Float)
rating = Column(Float)
class Style(Base):
__tablename__ = "style"
userid = Column(Integer, ForeignKey('uinfo.id'), primary_key=True)
wide = Column(Float)
slim = Column(Float)
tapered = Column(Float)
crop = Column(Float)
class Product(Base):
__tablename__ = 'products'
product_id = Column(Integer, primary_key=True)
name = Column(String(100), nullable=False)
hashtag = Column(String(200))
rating = Column(Float)
image = Column(String(200))
xs_size = Column(String(10))
purchase_total = Column(String(100))
view_total = Column(String(100))
purchase_age = Column(String(100))
view_age = Column(String(100))
price = Column(Integer)
heart = Column(Integer)
ratew = Column(Float)
tpw = Column(Float)
class Review(Base):
__tablename__ = 'reviews'
review_id = Column(Integer, primary_key=True)
product_id = Column(Integer, ForeignKey('products.product_id'))
name = Column(String(100), nullable=False)
gender = Column(String(10))
height = Column(Integer)
weight = Column(Integer)
rating = Column(Float)
fit_size = Column(String(4))
evls = Column(Integer)
evlb = Column(Integer)
evlc = Column(Integer)
evlt = Column(Integer)
link = Column(String(1000))
class Age(Base):
__tablename__ = "age"
agegroup = Column(Integer, primary_key=True)
class ProductAge(Base):
__tablename__ = "products_age"
product_id = Column(Integer, ForeignKey(
'products.product_id'), primary_key=True)
agegroup = Column(Integer, ForeignKey('age.agegroup'), primary_key=True)
apw = Column(Float)