| 15086 |
amit.gupta |
1 |
from sqlalchemy import create_engine
|
| 15011 |
amit.gupta |
2 |
from elixir import *
|
| 14039 |
kshitij.so |
3 |
from elixir.entity import Entity
|
|
|
4 |
from elixir.fields import Field
|
|
|
5 |
from elixir.options import using_options, using_table_options
|
| 15081 |
amit.gupta |
6 |
from sqlalchemy.sql.expression import func
|
| 15011 |
amit.gupta |
7 |
from sqlalchemy.types import Integer, String, DateTime, Float, Boolean, Enum, \
|
|
|
8 |
Text
|
| 15234 |
amit.gupta |
9 |
from sqlalchemy.dialects.mysql.base import LONGTEXT
|
| 14039 |
kshitij.so |
10 |
|
|
|
11 |
|
|
|
12 |
class Users(Entity):
|
|
|
13 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
14 |
username = Field(String(128))
|
|
|
15 |
email = Field(String(128))
|
|
|
16 |
password = Field(String(64))
|
|
|
17 |
first_name = Field(String(64))
|
|
|
18 |
last_name = Field(String(64))
|
|
|
19 |
mobile_number = Field(String(15))
|
|
|
20 |
referral_url = Field(String(256))
|
|
|
21 |
referrer = Field(String(32))
|
|
|
22 |
password_reset = Field(String(64))
|
|
|
23 |
activation_code = Field(String(40))
|
| 15917 |
amit.gupta |
24 |
address_line_1 = Field(String(128))
|
|
|
25 |
address_line_2 = Field(String(128))
|
|
|
26 |
city = Field(String(128))
|
|
|
27 |
state = Field(String(64))
|
|
|
28 |
pincode = Field(String(6))
|
| 15393 |
amit.gupta |
29 |
activated = Field(Boolean)
|
| 14039 |
kshitij.so |
30 |
group_id = Field(Integer(unsigned=True), default=1, server_default='1')
|
|
|
31 |
status = Field(Boolean, default=True, server_default='1')
|
| 15245 |
manas |
32 |
utm_campaign = Field(String(128))
|
| 15365 |
amit.gupta |
33 |
activation_time = Field(DateTime)
|
| 14039 |
kshitij.so |
34 |
created = Field(DateTime)
|
|
|
35 |
modified = Field(DateTime)
|
| 15191 |
manish.sha |
36 |
usergroup_id = Field(Text)
|
| 14039 |
kshitij.so |
37 |
using_options(shortnames=True)
|
|
|
38 |
using_table_options(mysql_engine="InnoDB")
|
|
|
39 |
|
|
|
40 |
class user_actions(Entity):
|
|
|
41 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
42 |
user_id = Field(Integer(unsigned=True))
|
|
|
43 |
store_product_id = Field(Integer(unsigned=True))
|
|
|
44 |
action = Field(Enum('like','dislike'))
|
| 15392 |
amit.gupta |
45 |
created = Field(DateTime, default=func.now())
|
| 14039 |
kshitij.so |
46 |
using_options(shortnames=True)
|
|
|
47 |
using_table_options(mysql_engine="InnoDB")
|
| 15369 |
amit.gupta |
48 |
|
|
|
49 |
class OnboardedRetailerChecklists(Entity):
|
|
|
50 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
51 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
52 |
number_verification = Field(Boolean)
|
|
|
53 |
preferences = Field(Boolean)
|
|
|
54 |
doa_return_policy = Field(Boolean)
|
|
|
55 |
payment_option = Field(Boolean)
|
|
|
56 |
contact_us = Field(Boolean)
|
| 15371 |
amit.gupta |
57 |
product_info = Field(Boolean)
|
|
|
58 |
redeem = Field(Boolean)
|
| 15392 |
amit.gupta |
59 |
created = Field(DateTime,default=func.now())
|
| 15369 |
amit.gupta |
60 |
using_options(shortnames=True)
|
|
|
61 |
using_table_options(mysql_engine="InnoDB")
|
| 14039 |
kshitij.so |
62 |
|
|
|
63 |
class brand_preferences(Entity):
|
|
|
64 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
65 |
user_id = Field(Integer(unsigned=True))
|
|
|
66 |
category_id = Field(Integer(unsigned=True))
|
|
|
67 |
brand = Field(String(128))
|
|
|
68 |
status = Field(Enum('show','hide'),default='hide', server_default='hide')
|
|
|
69 |
created = Field(DateTime)
|
|
|
70 |
modified = Field(DateTime)
|
|
|
71 |
using_options(shortnames=True)
|
|
|
72 |
using_table_options(mysql_engine="InnoDB")
|
|
|
73 |
|
|
|
74 |
class price_preferences(Entity):
|
|
|
75 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
76 |
user_id = Field(Integer(unsigned=True))
|
|
|
77 |
category_id = Field(Integer(unsigned=True))
|
|
|
78 |
min_price = Field(Float, default=0.0, server_default="0.0")
|
|
|
79 |
max_price = Field(Float, default=0.0, server_default="0.0")
|
|
|
80 |
created = Field(DateTime)
|
|
|
81 |
modified = Field(DateTime)
|
|
|
82 |
using_options(shortnames=True)
|
|
|
83 |
using_table_options(mysql_engine="InnoDB")
|
|
|
84 |
|
| 14769 |
kshitij.so |
85 |
class Brands(Entity):
|
|
|
86 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
87 |
name = Field(String(128))
|
|
|
88 |
category_id = Field(Integer)
|
|
|
89 |
using_options(shortnames=True)
|
|
|
90 |
using_table_options(mysql_engine="InnoDB")
|
| 14859 |
manish.sha |
91 |
|
| 14921 |
manish.sha |
92 |
class Feedbacks(Entity):
|
| 14859 |
manish.sha |
93 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
94 |
user_id = Field(Integer(unsigned=True))
|
|
|
95 |
email = Field(String(128))
|
|
|
96 |
subject = Field(String(256))
|
|
|
97 |
message = Field(Text)
|
|
|
98 |
created = Field(DateTime)
|
|
|
99 |
isTicketCreated = Field(Boolean, default=False, server_default='0')
|
| 14921 |
manish.sha |
100 |
using_options(shortnames=True)
|
|
|
101 |
using_table_options(mysql_engine="InnoDB")
|
| 14039 |
kshitij.so |
102 |
|
| 15011 |
amit.gupta |
103 |
class Postoffices(Entity):
|
|
|
104 |
id = Field(Integer(10, unsigned=True), primary_key=True)
|
|
|
105 |
name = Field(String(128))
|
|
|
106 |
pincode = Field(Integer(6, unsigned=True))
|
|
|
107 |
deliverystatus = Field(Boolean)
|
|
|
108 |
divisionname = Field(String(128))
|
|
|
109 |
regionname = Field(String(128))
|
|
|
110 |
taluk = Field(String(128))
|
|
|
111 |
district = Field(String(128))
|
|
|
112 |
state = Field(String(128))
|
|
|
113 |
using_options(shortnames=True)
|
|
|
114 |
using_table_options(mysql_engine="InnoDB")
|
|
|
115 |
|
| 15048 |
kshitij.so |
116 |
class Orders(Entity):
|
|
|
117 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
118 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
119 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
120 |
order_url = Field(String(256))
|
|
|
121 |
status = Field(String(32))
|
|
|
122 |
created = Field(DateTime)
|
|
|
123 |
modified = Field(DateTime)
|
|
|
124 |
using_options(shortnames=True)
|
|
|
125 |
using_table_options(mysql_engine="InnoDB")
|
|
|
126 |
|
| 15532 |
amit.gupta |
127 |
class FlipkartOrders(Entity):
|
|
|
128 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
129 |
user_id = Field(Integer(unsigned=True))
|
|
|
130 |
email = Field(String(128))
|
|
|
131 |
subtagId= Field(String(32))
|
|
|
132 |
identifier = Field(String(32))
|
|
|
133 |
catalogId = Field(Integer)
|
|
|
134 |
title = Field(String(128))
|
|
|
135 |
brand = Field(String(64))
|
|
|
136 |
model = Field(String(64))
|
|
|
137 |
status = Field(String(16))
|
|
|
138 |
price = Field(Float)
|
|
|
139 |
category = Field(String(16))
|
|
|
140 |
quantity = Field(SmallInteger)
|
|
|
141 |
created = Field(DateTime)
|
|
|
142 |
modified = Field(DateTime)
|
|
|
143 |
using_options(shortnames=True)
|
|
|
144 |
using_table_options(mysql_engine="InnoDB")
|
|
|
145 |
|
| 15234 |
amit.gupta |
146 |
class OrdersRaw(Entity):
|
|
|
147 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
148 |
user_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
149 |
store_id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
150 |
order_url = Field(String(256))
|
| 15566 |
amit.gupta |
151 |
sub_tag = Field(String(32))
|
| 15554 |
amit.gupta |
152 |
rawhtml = Field(LONGTEXT)
|
| 15234 |
amit.gupta |
153 |
status = Field(String(32))
|
|
|
154 |
created = Field(DateTime)
|
|
|
155 |
modified = Field(DateTime)
|
| 15236 |
amit.gupta |
156 |
using_options(tablename="orders")
|
|
|
157 |
using_table_options(useexisting=True,mysql_engine="InnoDB")
|
| 15234 |
amit.gupta |
158 |
|
| 15081 |
amit.gupta |
159 |
class Retailers(Entity):
|
|
|
160 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15083 |
amit.gupta |
161 |
identifier = Field(String(128))
|
| 15081 |
amit.gupta |
162 |
title = Field(String(256))
|
|
|
163 |
address = Field(String(512))
|
| 15254 |
amit.gupta |
164 |
address_new = Field(String(512))
|
| 15081 |
amit.gupta |
165 |
agent_id=Field(Integer(unsigned=True))
|
|
|
166 |
contact1 = Field(String(10))
|
|
|
167 |
contact2 = Field(String(10))
|
|
|
168 |
pin = Field(String(6))
|
| 15254 |
amit.gupta |
169 |
cod_limit = Field(Integer(10))
|
| 15675 |
amit.gupta |
170 |
city = Field(String(64))
|
| 15081 |
amit.gupta |
171 |
state = Field(String(48))
|
|
|
172 |
status = Field(String(20))
|
| 15083 |
amit.gupta |
173 |
is_elavated = Field(Boolean)
|
| 15086 |
amit.gupta |
174 |
retry_count = Field(Integer(3))
|
|
|
175 |
invalid_retry_count = Field(Integer(3))
|
| 15081 |
amit.gupta |
176 |
call_priority = Field(Enum('user_initiated', 'system_initiated'))
|
|
|
177 |
next_call_time = Field(DateTime)
|
| 15086 |
amit.gupta |
178 |
is_std = Field(Boolean)
|
|
|
179 |
is_or = Field(Boolean)
|
| 15081 |
amit.gupta |
180 |
created = Field(DateTime)
|
| 15110 |
amit.gupta |
181 |
disposition = Field(String(32))
|
| 15099 |
amit.gupta |
182 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
| 15081 |
amit.gupta |
183 |
using_options(shortnames=True)
|
|
|
184 |
using_table_options(mysql_engine="InnoDB")
|
| 15331 |
amit.gupta |
185 |
|
| 15680 |
amit.gupta |
186 |
class RetailerAddresses(Entity):
|
| 15676 |
amit.gupta |
187 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
188 |
retailer_id = Field(Integer(unsigned=True))
|
| 15681 |
amit.gupta |
189 |
title = Field(String(128))
|
| 15676 |
amit.gupta |
190 |
agent_id=Field(Integer(unsigned=True))
|
|
|
191 |
address = Field(String(512))
|
|
|
192 |
city = Field(String(64))
|
|
|
193 |
state = Field(String(48))
|
|
|
194 |
pin = Field(String(6))
|
| 15683 |
amit.gupta |
195 |
created = Field(DateTime,default=func.now())
|
| 15676 |
amit.gupta |
196 |
using_options(shortnames=True)
|
|
|
197 |
using_table_options(mysql_engine="InnoDB")
|
| 15675 |
amit.gupta |
198 |
class DailySourcewiseOrderInfo(Entity):
|
|
|
199 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
200 |
source = Field(Integer(2))
|
|
|
201 |
order_count = Field(Integer(4))
|
|
|
202 |
quantity_count = Field(Integer(4))
|
|
|
203 |
sale_amount = Field(Integer(10))
|
|
|
204 |
created = Field(DateTime)
|
|
|
205 |
modified = Field(DateTime, default=func.now(), onupdate=func.now())
|
|
|
206 |
using_options(shortnames=True)
|
|
|
207 |
using_table_options(mysql_engine="InnoDB")
|
|
|
208 |
|
| 15331 |
amit.gupta |
209 |
class AlreadyCalledNumbers(Entity):
|
|
|
210 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
211 |
mobile_number = Field(String(10), unique=True)
|
| 15352 |
amit.gupta |
212 |
using_options(shortnames=True)
|
|
|
213 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
214 |
|
| 15710 |
amit.gupta |
215 |
class Pincodeavailability(Entity):
|
|
|
216 |
code = Field(String(6), unique=True)
|
|
|
217 |
amount = Field(Integer(11))
|
|
|
218 |
using_options(shortnames=True)
|
|
|
219 |
using_table_options(mysql_engine="InnoDB")
|
|
|
220 |
|
| 15254 |
amit.gupta |
221 |
class RetailerContacts(Entity):
|
|
|
222 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
223 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
224 |
agent_id = Field(Integer(unsigned=True))
|
|
|
225 |
mobile_number = Field(String(10))
|
| 15260 |
amit.gupta |
226 |
contact_type = Field(Enum('sms', 'called', 'ringing'))
|
| 15254 |
amit.gupta |
227 |
call_type = Field(String(10))
|
|
|
228 |
created = Field(DateTime,default=func.now())
|
|
|
229 |
using_options(shortnames=True)
|
|
|
230 |
using_table_options(mysql_engine="InnoDB")
|
|
|
231 |
|
|
|
232 |
|
| 15096 |
amit.gupta |
233 |
class CallHistory(Entity):
|
|
|
234 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
235 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
236 |
agent_id = Field(Integer(unsigned=True))
|
|
|
237 |
mobile_number = Field(String(10))
|
| 15113 |
amit.gupta |
238 |
call_type = Field(String(10))
|
| 15096 |
amit.gupta |
239 |
sms_verified = Field(Boolean)
|
|
|
240 |
call_time = Field(DateTime)
|
|
|
241 |
duration_sec = Field(Integer)
|
| 15234 |
amit.gupta |
242 |
last_fetch_time = Field(DateTime)
|
| 15377 |
amit.gupta |
243 |
call_disposition = Field(Enum('call_later','ringing_no_answer', 'not_reachable', 'switch_off', 'invalid_no', 'wrong_no', 'hang_up','retailer_not_interested', 'alreadyuser', 'verified_link_sent', 'onboarded'))
|
| 15096 |
amit.gupta |
244 |
disposition_description = Field(String(192))
|
| 15201 |
manas |
245 |
disposition_comments = Field(String(192))
|
| 15096 |
amit.gupta |
246 |
created = Field(DateTime,default=func.now())
|
| 15110 |
amit.gupta |
247 |
using_options(shortnames=True)
|
|
|
248 |
using_table_options(mysql_engine="InnoDB")
|
| 15096 |
amit.gupta |
249 |
|
| 15081 |
amit.gupta |
250 |
class RetryConfig(Entity):
|
| 15359 |
amit.gupta |
251 |
call_type = Field(Enum('fresh', 'followup', 'onboarding'))
|
| 15096 |
amit.gupta |
252 |
disposition_type = Field(Enum('ringing_no_answer', 'not_reachable'))
|
| 15081 |
amit.gupta |
253 |
retry_count = Field(Integer(unsigned=True))
|
| 15110 |
amit.gupta |
254 |
minutes_ahead = Field(Integer(unsigned=True))
|
| 15081 |
amit.gupta |
255 |
using_options(shortnames=True)
|
|
|
256 |
using_table_options(mysql_engine="InnoDB")
|
| 15133 |
amit.gupta |
257 |
|
|
|
258 |
class RetailerLinks(Entity):
|
| 15234 |
amit.gupta |
259 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| 15254 |
amit.gupta |
260 |
retailer_id = Field(Integer(unsigned=True), unique=True)
|
| 15138 |
amit.gupta |
261 |
agent_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
262 |
code = Field(String(10), unique=True)
|
| 15278 |
amit.gupta |
263 |
mapped_with = Field(String)
|
| 15133 |
amit.gupta |
264 |
activated = Field(DateTime,onupdate=func.now())
|
| 15255 |
amit.gupta |
265 |
user_id = Field(Integer(unsigned=True))
|
| 15133 |
amit.gupta |
266 |
created = Field(DateTime,default=func.now())
|
|
|
267 |
using_options(shortnames=True)
|
|
|
268 |
using_table_options(mysql_engine="InnoDB")
|
| 15135 |
amit.gupta |
269 |
|
|
|
270 |
class Activation_Codes(Entity):
|
|
|
271 |
code = Field(String(10))
|
| 15138 |
amit.gupta |
272 |
created = Field(DateTime, default=func.now())
|
| 15144 |
amit.gupta |
273 |
using_options(shortnames=True)
|
|
|
274 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
275 |
|
| 15189 |
manas |
276 |
class Agents(Entity):
|
|
|
277 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
278 |
name = Field(String(64))
|
|
|
279 |
email = Field(String(100))
|
|
|
280 |
password = Field(String(64))
|
|
|
281 |
type = Field(Enum('crm','fos'))
|
|
|
282 |
last_login = Field(DateTime)
|
| 15533 |
amit.gupta |
283 |
login_type = Field(String(10))
|
| 15189 |
manas |
284 |
created = Field(DateTime, default=func.now())
|
|
|
285 |
using_options(shortnames=True)
|
|
|
286 |
using_table_options(mysql_engine="InnoDB")
|
|
|
287 |
|
|
|
288 |
class Agent_Roles(Entity):
|
|
|
289 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
290 |
agent_id = Field(Integer(unsigned=True))
|
|
|
291 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
292 |
created = Field(DateTime, default=func.now())
|
|
|
293 |
using_options(shortnames=True)
|
|
|
294 |
using_table_options(mysql_engine="InnoDB")
|
| 15081 |
amit.gupta |
295 |
|
| 15189 |
manas |
296 |
class AgentLoginTimings(Entity):
|
|
|
297 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
298 |
agent_id = Field(Integer(unsigned=True))
|
|
|
299 |
role = Field(Enum('fresh','followup','onboarding'))
|
|
|
300 |
loginTime = Field(DateTime)
|
|
|
301 |
logoutTime = Field(DateTime)
|
|
|
302 |
created = Field(DateTime, default=func.now())
|
|
|
303 |
using_options(shortnames=True)
|
|
|
304 |
using_table_options(mysql_engine="InnoDB")
|
| 15424 |
amit.gupta |
305 |
|
|
|
306 |
class Clicks(Entity):
|
|
|
307 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
308 |
user_id = Field(Integer(unsigned=True))
|
|
|
309 |
tag = Field(String(20))
|
|
|
310 |
created = Field(DateTime, default=func.now())
|
|
|
311 |
using_options(shortnames=True)
|
|
|
312 |
using_table_options(mysql_engine="InnoDB")
|
| 15189 |
manas |
313 |
|
| 15234 |
amit.gupta |
314 |
class FetchDataHistory(Entity):
|
|
|
315 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
316 |
retailer_id = Field(Integer(unsigned=True))
|
|
|
317 |
agent_id = Field(Integer(unsigned=True))
|
|
|
318 |
call_type = Field(String(10))
|
|
|
319 |
last_action = Field(Enum('login','disposition'))
|
|
|
320 |
last_action_time = Field(DateTime)
|
|
|
321 |
created = Field(DateTime,default=func.now())
|
|
|
322 |
using_options(shortnames=True)
|
|
|
323 |
using_table_options(mysql_engine="InnoDB")
|
|
|
324 |
|
| 15690 |
manish.sha |
325 |
class Pushnotifications(Entity):
|
|
|
326 |
id = Field(Integer(unsigned=True), primary_key=True)
|
|
|
327 |
user_id = Field(Integer(unsigned=True))
|
|
|
328 |
notification_campaign_id = Field(Integer(unsigned=True))
|
|
|
329 |
type = Field(String(16))
|
|
|
330 |
status = Field(Boolean)
|
|
|
331 |
message = Field(String(64))
|
|
|
332 |
response_time = Field(DateTime)
|
|
|
333 |
created = Field(DateTime)
|
|
|
334 |
using_options(shortnames=True)
|
|
|
335 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
336 |
|
| 15791 |
manish.sha |
337 |
|
|
|
338 |
class MerchantSubOrders(Entity):
|
|
|
339 |
orderId = Field(Integer, primary_key= True, autoincrement=False)
|
|
|
340 |
merchantOrderId = Field(String(30), primary_key=True)
|
|
|
341 |
merchantSubOrderId = Field(String(50), primary_key=True)
|
|
|
342 |
storeId = Field(Integer)
|
|
|
343 |
userId = Field(Integer)
|
|
|
344 |
productCode = Field(String(50))
|
|
|
345 |
brand = Field(String(30))
|
|
|
346 |
productName = Field(String(50))
|
|
|
347 |
amountPaid = Field(Float)
|
|
|
348 |
quantity = Field(Integer)
|
|
|
349 |
unitPrice = Field(Float)
|
|
|
350 |
status = Field(String(30))
|
|
|
351 |
createdTime = Field(DateTime)
|
|
|
352 |
using_options(shortnames=True)
|
|
|
353 |
using_table_options(mysql_engine="InnoDB")
|
| 15816 |
amit.gupta |
354 |
|
|
|
355 |
class NotificationViews(Entity):
|
|
|
356 |
id = Field(Integer, primary_key= True)
|
|
|
357 |
user_id = Field(Integer(unsigned=True))
|
|
|
358 |
notification_rule_id = Field(Integer(unsigned=True))
|
|
|
359 |
created = Field(DateTime)
|
|
|
360 |
using_options(shortnames=True)
|
|
|
361 |
using_table_options(mysql_engine="InnoDB")
|
|
|
362 |
|
|
|
363 |
class MissingAmazonOrderUsers(Entity):
|
|
|
364 |
user_id = Field(Integer, primary_key= True)
|
|
|
365 |
using_options(shortnames=True)
|
|
|
366 |
using_table_options(mysql_engine="InnoDB")
|
|
|
367 |
class PendingToTrackAmazonOrderUsers(Entity):
|
|
|
368 |
user_id = Field(Integer, primary_key= True)
|
|
|
369 |
using_options(shortnames=True)
|
|
|
370 |
using_table_options(mysql_engine="InnoDB")
|
|
|
371 |
|
|
|
372 |
|
| 15917 |
amit.gupta |
373 |
class User_addresses(Entity):
|
|
|
374 |
id = Field(Integer, primary_key= True)
|
|
|
375 |
user_id = Field(Integer(unsigned=True))
|
|
|
376 |
store_name = Field(String(128))
|
|
|
377 |
address = Field(String(256))
|
|
|
378 |
city = Field(String(64))
|
|
|
379 |
pincode = Field(String(6))
|
|
|
380 |
state = Field(String(48))
|
|
|
381 |
created = Field(DateTime,default=func.now())
|
|
|
382 |
using_options(shortnames=True)
|
|
|
383 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
384 |
|
| 15917 |
amit.gupta |
385 |
class All_user_addresses(Entity):
|
|
|
386 |
id = Field(Integer, primary_key= True)
|
|
|
387 |
user_id = Field(Integer(unsigned=True))
|
|
|
388 |
address = Field(String(256))
|
|
|
389 |
store_name = Field(String(128))
|
|
|
390 |
city = Field(String(64))
|
|
|
391 |
pincode = Field(String(6))
|
|
|
392 |
state = Field(String(48))
|
|
|
393 |
source = Field(Enum('retailer_crm_edited', 'retailer_master', 'fos_crm', 'user_profile'))
|
|
|
394 |
created = Field(DateTime,default=func.now())
|
|
|
395 |
using_options(shortnames=True)
|
|
|
396 |
using_table_options(mysql_engine="InnoDB")
|
| 15690 |
manish.sha |
397 |
|
| 14826 |
kshitij.so |
398 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
| 14039 |
kshitij.so |
399 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
|
|
400 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
|
|
401 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
|
|
402 |
metadata.bind = cengine
|
| 14826 |
kshitij.so |
403 |
metadata.bind.echo = echo
|
| 14039 |
kshitij.so |
404 |
setup_all(True)
|
|
|
405 |
|
|
|
406 |
if __name__=="__main__":
|
|
|
407 |
initialize()
|
| 15011 |
amit.gupta |
408 |
|
|
|
409 |
|
|
|
410 |
|