create-nextjs-cms 0.8.8 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,383 +1,448 @@
|
|
|
1
|
-
import {mysqlTable,int,longtext,mysqlEnum,varchar,boolean,double,timestamp} from 'drizzle-orm/mysql-core'
|
|
2
|
-
|
|
3
|
-
export const AppInfoTable = mysqlTable('app_info', {
|
|
4
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
5
|
-
aboutEn: longtext('about_en').notNull(),
|
|
6
|
-
aboutAr: longtext('about_ar').notNull(),
|
|
7
|
-
aboutTr: longtext('about_tr').notNull(),
|
|
8
|
-
privacyEn: longtext('privacy_en').notNull(),
|
|
9
|
-
privacyAr: longtext('privacy_ar').notNull(),
|
|
10
|
-
privacyTr: longtext('privacy_tr').notNull()
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export const UserReportsTable = mysqlTable('user_reports', {
|
|
15
|
-
id: int('id').autoincrement().notNull().primaryKey(),
|
|
16
|
-
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
17
|
-
reportType: mysqlEnum('report_type', ['explicit_content', 'wrong_information', 'no_longer_available', 'user_not_responsive', 'other']).notNull(),
|
|
18
|
-
contentId: int('content_id').notNull(),
|
|
19
|
-
catId: int('cat_id').notNull(),
|
|
20
|
-
userId: int('user_id'),
|
|
21
|
-
appId: varchar('app_id', { length: 36 }).notNull(),
|
|
22
|
-
title: varchar('title', { length: 255 }).notNull(),
|
|
23
|
-
slug: varchar('slug', { length: 255 }).notNull()
|
|
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
|
-
title: varchar('title', { length: 255 }).notNull(),
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
})
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
})
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
condition: varchar('condition', { length: 255 }).notNull(),
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
})
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
})
|
|
383
|
-
|
|
1
|
+
import {mysqlTable,int,longtext,mysqlEnum,varchar,index,unique,boolean,double,timestamp} from 'drizzle-orm/mysql-core'
|
|
2
|
+
|
|
3
|
+
export const AppInfoTable = mysqlTable('app_info', {
|
|
4
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
5
|
+
aboutEn: longtext('about_en').notNull(),
|
|
6
|
+
aboutAr: longtext('about_ar').notNull(),
|
|
7
|
+
aboutTr: longtext('about_tr').notNull(),
|
|
8
|
+
privacyEn: longtext('privacy_en').notNull(),
|
|
9
|
+
privacyAr: longtext('privacy_ar').notNull(),
|
|
10
|
+
privacyTr: longtext('privacy_tr').notNull()
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export const UserReportsTable = mysqlTable('user_reports', {
|
|
15
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
16
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
17
|
+
reportType: mysqlEnum('report_type', ['explicit_content', 'wrong_information', 'no_longer_available', 'user_not_responsive', 'other']).notNull(),
|
|
18
|
+
contentId: int('content_id').notNull(),
|
|
19
|
+
catId: int('cat_id').notNull(),
|
|
20
|
+
userId: int('user_id'),
|
|
21
|
+
appId: varchar('app_id', { length: 36 }).notNull(),
|
|
22
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
23
|
+
slug: varchar('slug', { length: 255 }).notNull()
|
|
24
|
+
}, (table) => [
|
|
25
|
+
index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.appId),
|
|
26
|
+
unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.appId),
|
|
27
|
+
unique('slug_unique').on(table.slug)
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
export const TestSectionTable = mysqlTable('test_section', {
|
|
32
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
33
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
34
|
+
price: int('price'),
|
|
35
|
+
appId: varchar('app_id', { length: 36 }).notNull(),
|
|
36
|
+
title: varchar('title', { length: 255 }).notNull()
|
|
37
|
+
}, (table) => [
|
|
38
|
+
index('unique_user_report_index').on(table.contentType, table.price, table.appId),
|
|
39
|
+
unique('unique_user_report').on(table.contentType, table.price, table.appId),
|
|
40
|
+
unique('price_unique').on(table.price)
|
|
41
|
+
]);
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export const FeaturedSliderTable = mysqlTable('featured_slider', {
|
|
45
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
46
|
+
image: varchar('image', { length: 255 }).notNull(),
|
|
47
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
48
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
49
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
50
|
+
descEn: longtext('desc_en').notNull(),
|
|
51
|
+
descAr: longtext('desc_ar').notNull(),
|
|
52
|
+
descTr: longtext('desc_tr').notNull()
|
|
53
|
+
}, (table) => [
|
|
54
|
+
unique('title_en_unique').on(table.titleEn),
|
|
55
|
+
unique('title_ar_unique').on(table.titleAr),
|
|
56
|
+
unique('title_tr_unique').on(table.titleTr)
|
|
57
|
+
]);
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export const MenuSettingsTable = mysqlTable('menu_settings', {
|
|
61
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
62
|
+
taxRate: varchar('tax_rate', { length: 255 }),
|
|
63
|
+
hideSlider: boolean('hide_slider')
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export const ServicesTable = mysqlTable('services', {
|
|
68
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
69
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
70
|
+
catId: int('cat_id').notNull(),
|
|
71
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
72
|
+
price: int('price'),
|
|
73
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
|
|
74
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
75
|
+
desc: longtext('desc'),
|
|
76
|
+
latitude: double('latitude'),
|
|
77
|
+
longitude: double('longitude'),
|
|
78
|
+
viewCount: int('view_count'),
|
|
79
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
80
|
+
govId: int('gov_id').notNull(),
|
|
81
|
+
districtId: int('district_id').notNull(),
|
|
82
|
+
subDistrictId: int('sub_district_id'),
|
|
83
|
+
townId: int('town_id')
|
|
84
|
+
}, (table) => [
|
|
85
|
+
index('title_index').on(table.title),
|
|
86
|
+
unique('title_unique').on(table.title)
|
|
87
|
+
]);
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
export const RealestateTable = mysqlTable('realestate', {
|
|
91
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
92
|
+
catId: int('cat_id').notNull(),
|
|
93
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
94
|
+
price: int('price').notNull(),
|
|
95
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
96
|
+
spaceGross: int('space_gross').notNull(),
|
|
97
|
+
spaceNet: int('space_net').notNull(),
|
|
98
|
+
latitude: double('latitude').notNull(),
|
|
99
|
+
longitude: double('longitude').notNull(),
|
|
100
|
+
roomCount: varchar('room_count', { length: 255 }),
|
|
101
|
+
buildingAge: varchar('building_age', { length: 255 }),
|
|
102
|
+
floorCount: varchar('floor_count', { length: 255 }),
|
|
103
|
+
bathroomCount: varchar('bathroom_count', { length: 255 }),
|
|
104
|
+
floorLocation: varchar('floor_location', { length: 255 }),
|
|
105
|
+
heatingType: varchar('heating_type', { length: 255 }),
|
|
106
|
+
kitchenType: varchar('kitchen_type', { length: 255 }),
|
|
107
|
+
balcony: boolean('balcony'),
|
|
108
|
+
lift: boolean('lift'),
|
|
109
|
+
parkingType: varchar('parking_type', { length: 255 }),
|
|
110
|
+
furnished: boolean('furnished'),
|
|
111
|
+
belongsToSite: boolean('belongs_to_site'),
|
|
112
|
+
siteName: varchar('site_name', { length: 255 }),
|
|
113
|
+
installments: boolean('installments'),
|
|
114
|
+
exchangeable: boolean('exchangeable'),
|
|
115
|
+
fromWhom: varchar('from_whom', { length: 255 }),
|
|
116
|
+
buildingMembershipFees: int('building_membership_fees'),
|
|
117
|
+
deposit: int('deposit'),
|
|
118
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
119
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
120
|
+
desc: longtext('desc'),
|
|
121
|
+
viewCount: int('view_count'),
|
|
122
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
123
|
+
govId: int('gov_id').notNull(),
|
|
124
|
+
districtId: int('district_id').notNull(),
|
|
125
|
+
subDistrictId: int('sub_district_id'),
|
|
126
|
+
townId: int('town_id')
|
|
127
|
+
}, (table) => [
|
|
128
|
+
index('title_index').on(table.title),
|
|
129
|
+
unique('title_unique').on(table.title)
|
|
130
|
+
]);
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
export const HomepageSliderTable = mysqlTable('homepage_slider', {
|
|
134
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
135
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
136
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
137
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
138
|
+
subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
|
|
139
|
+
subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
|
|
140
|
+
subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
|
|
141
|
+
photo: varchar('photo', { length: 255 }).notNull(),
|
|
142
|
+
buttonUrl: varchar('button_url', { length: 255 }),
|
|
143
|
+
buttonTextEn: varchar('button_text_en', { length: 255 }),
|
|
144
|
+
buttonTextAr: varchar('button_text_ar', { length: 255 }),
|
|
145
|
+
buttonTextTr: varchar('button_text_tr', { length: 255 }),
|
|
146
|
+
buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
|
|
151
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
152
|
+
userId: int('user_id').notNull(),
|
|
153
|
+
contestId: varchar('contest_id', { length: 255 }).notNull()
|
|
154
|
+
}, (table) => [
|
|
155
|
+
unique('contest_subscriber_unique').on(table.contestId, table.userId)
|
|
156
|
+
]);
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
export const ContestsTable = mysqlTable('contests', {
|
|
160
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
161
|
+
date: timestamp('date').notNull(),
|
|
162
|
+
prize: varchar('prize', { length: 255 }).notNull(),
|
|
163
|
+
winnerId: int('winner_id'),
|
|
164
|
+
tags: varchar('tags', { length: 255 })
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
export const NotificationsTable = mysqlTable('notifications', {
|
|
169
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
170
|
+
type: mysqlEnum('type', ['ad_price_updated', 'ad_updated', 'ad_activated', 'ad_pending_review', 'ad_expired', 'ad_rejected', 'ad_viewed', 'ad_favorited', 'ad_shared', 'ad_reported', 'ad_deleted', 'ad_created', 'contest_winner', 'contest_reminder', 'contest_created', 'custom']).notNull(),
|
|
171
|
+
contentId: int('content_id'),
|
|
172
|
+
contentCatId: int('content_cat_id'),
|
|
173
|
+
userId: int('user_id'),
|
|
174
|
+
message: varchar('message', { length: 255 })
|
|
175
|
+
}, (table) => [
|
|
176
|
+
index('type_index').on(table.type),
|
|
177
|
+
unique('unique_notification').on(table.type, table.contentId, table.contentCatId)
|
|
178
|
+
]);
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
export const ModerationTable = mysqlTable('moderation', {
|
|
182
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
183
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
184
|
+
contentId: int('content_id').notNull(),
|
|
185
|
+
catId: int('cat_id'),
|
|
186
|
+
userId: int('user_id').notNull(),
|
|
187
|
+
flagged: int('flagged').notNull(),
|
|
188
|
+
result: varchar('result', { length: 255 }).notNull()
|
|
189
|
+
}, (table) => [
|
|
190
|
+
index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.userId),
|
|
191
|
+
unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.userId)
|
|
192
|
+
]);
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
export const JobsTable = mysqlTable('jobs', {
|
|
196
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
197
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
198
|
+
catId: int('cat_id').notNull(),
|
|
199
|
+
salary: int('salary'),
|
|
200
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
201
|
+
workMethod: varchar('work_method', { length: 255 }).notNull(),
|
|
202
|
+
minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
|
|
203
|
+
experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
|
|
204
|
+
remote: boolean('remote'),
|
|
205
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
206
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
207
|
+
desc: longtext('desc'),
|
|
208
|
+
latitude: double('latitude'),
|
|
209
|
+
longitude: double('longitude'),
|
|
210
|
+
viewCount: int('view_count'),
|
|
211
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
212
|
+
govId: int('gov_id').notNull(),
|
|
213
|
+
districtId: int('district_id').notNull(),
|
|
214
|
+
subDistrictId: int('sub_district_id'),
|
|
215
|
+
townId: int('town_id')
|
|
216
|
+
}, (table) => [
|
|
217
|
+
index('title_index').on(table.title),
|
|
218
|
+
unique('title_unique').on(table.title)
|
|
219
|
+
]);
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
export const FurnitureTable = mysqlTable('furniture', {
|
|
223
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
224
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
225
|
+
catId: int('cat_id').notNull(),
|
|
226
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
227
|
+
price: int('price').notNull(),
|
|
228
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
229
|
+
exchangeable: boolean('exchangeable'),
|
|
230
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
231
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
232
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
233
|
+
desc: longtext('desc'),
|
|
234
|
+
latitude: double('latitude'),
|
|
235
|
+
longitude: double('longitude'),
|
|
236
|
+
viewCount: int('view_count'),
|
|
237
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
238
|
+
govId: int('gov_id').notNull(),
|
|
239
|
+
districtId: int('district_id').notNull(),
|
|
240
|
+
subDistrictId: int('sub_district_id'),
|
|
241
|
+
townId: int('town_id')
|
|
242
|
+
}, (table) => [
|
|
243
|
+
index('title_index').on(table.title),
|
|
244
|
+
unique('title_unique').on(table.title)
|
|
245
|
+
]);
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
export const FiltersTable = mysqlTable('filters', {
|
|
249
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
250
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
251
|
+
Key: varchar('_key', { length: 255 }).notNull(),
|
|
252
|
+
fieldName: varchar('field_name', { length: 255 }).notNull(),
|
|
253
|
+
type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
|
|
254
|
+
tableName: varchar('table_name', { length: 255 }),
|
|
255
|
+
isMandatory: boolean('is_mandatory')
|
|
256
|
+
}, (table) => [
|
|
257
|
+
unique('title_unique').on(table.title),
|
|
258
|
+
unique('key_unique').on(table.Key)
|
|
259
|
+
]);
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
export const FaqTable = mysqlTable('faq', {
|
|
263
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
264
|
+
qEn: varchar('q_en', { length: 255 }).notNull(),
|
|
265
|
+
qAr: varchar('q_ar', { length: 255 }).notNull(),
|
|
266
|
+
qTr: varchar('q_tr', { length: 255 }),
|
|
267
|
+
aEn: longtext('a_en').notNull(),
|
|
268
|
+
aAr: longtext('a_ar'),
|
|
269
|
+
aTr: longtext('a_tr')
|
|
270
|
+
}, (table) => [
|
|
271
|
+
unique('faq_q_en_unique').on(table.qEn),
|
|
272
|
+
unique('title_ar_unique').on(table.qAr),
|
|
273
|
+
unique('title_tr_unique').on(table.qTr)
|
|
274
|
+
]);
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
export const ErrorsTable = mysqlTable('errors', {
|
|
278
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
279
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
280
|
+
caseId: varchar('case_id', { length: 255 }).notNull(),
|
|
281
|
+
userId: int('user_id'),
|
|
282
|
+
itemSlug: varchar('item_slug', { length: 255 }),
|
|
283
|
+
desc: longtext('desc'),
|
|
284
|
+
isResolved: boolean('is_resolved')
|
|
285
|
+
}, (table) => [
|
|
286
|
+
unique('key_unique').on(table.caseId)
|
|
287
|
+
]);
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
export const ElectronicsTable = mysqlTable('electronics', {
|
|
291
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
292
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
293
|
+
catId: int('cat_id').notNull(),
|
|
294
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
295
|
+
price: int('price').notNull(),
|
|
296
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
297
|
+
exchangeable: boolean('exchangeable'),
|
|
298
|
+
installments: boolean('installments'),
|
|
299
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
300
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
301
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
302
|
+
desc: longtext('desc'),
|
|
303
|
+
latitude: double('latitude'),
|
|
304
|
+
longitude: double('longitude'),
|
|
305
|
+
viewCount: int('view_count'),
|
|
306
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
307
|
+
govId: int('gov_id').notNull(),
|
|
308
|
+
districtId: int('district_id').notNull(),
|
|
309
|
+
subDistrictId: int('sub_district_id'),
|
|
310
|
+
townId: int('town_id')
|
|
311
|
+
}, (table) => [
|
|
312
|
+
index('title_index').on(table.title),
|
|
313
|
+
unique('title_unique').on(table.title)
|
|
314
|
+
]);
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
export const ClothesTable = mysqlTable('clothes', {
|
|
318
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
319
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
320
|
+
catId: int('cat_id').notNull(),
|
|
321
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
322
|
+
price: int('price').notNull(),
|
|
323
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
324
|
+
exchangeable: boolean('exchangeable'),
|
|
325
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
326
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
327
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
328
|
+
desc: longtext('desc'),
|
|
329
|
+
latitude: double('latitude'),
|
|
330
|
+
longitude: double('longitude'),
|
|
331
|
+
viewCount: int('view_count'),
|
|
332
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
333
|
+
govId: int('gov_id').notNull(),
|
|
334
|
+
districtId: int('district_id').notNull(),
|
|
335
|
+
subDistrictId: int('sub_district_id'),
|
|
336
|
+
townId: int('town_id')
|
|
337
|
+
}, (table) => [
|
|
338
|
+
index('title_index').on(table.title),
|
|
339
|
+
unique('title_unique').on(table.title)
|
|
340
|
+
]);
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
export const CatsTable = mysqlTable('cats', {
|
|
344
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
345
|
+
catOrder: int('cat_order').notNull(),
|
|
346
|
+
slug: varchar('slug', { length: 255 }).notNull(),
|
|
347
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
348
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
349
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
350
|
+
fullTitleEn: varchar('full_title_en', { length: 255 }),
|
|
351
|
+
fullTitleAr: varchar('full_title_ar', { length: 255 }),
|
|
352
|
+
fullTitleTr: varchar('full_title_tr', { length: 255 }),
|
|
353
|
+
image: varchar('image', { length: 255 }),
|
|
354
|
+
metaDescEn: varchar('meta_desc_en', { length: 255 }),
|
|
355
|
+
metaDescAr: varchar('meta_desc_ar', { length: 255 }),
|
|
356
|
+
metaDescTr: varchar('meta_desc_tr', { length: 255 }),
|
|
357
|
+
filters: varchar('filters', { length: 255 }),
|
|
358
|
+
tableName: varchar('table_name', { length: 255 }).notNull(),
|
|
359
|
+
adCount: int('ad_count'),
|
|
360
|
+
parentId: int('parent_id'),
|
|
361
|
+
level: int('level')
|
|
362
|
+
}, (table) => [
|
|
363
|
+
unique('cats_slug_unique').on(table.slug)
|
|
364
|
+
]);
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
export const CarsTable = mysqlTable('cars', {
|
|
368
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
369
|
+
modelYear: int('model_year').notNull(),
|
|
370
|
+
model: varchar('model', { length: 255 }).notNull(),
|
|
371
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
372
|
+
catId: int('cat_id').notNull(),
|
|
373
|
+
govId: int('gov_id').notNull(),
|
|
374
|
+
districtId: int('district_id').notNull(),
|
|
375
|
+
subDistrictId: int('sub_district_id'),
|
|
376
|
+
townId: int('town_id'),
|
|
377
|
+
price: int('price').notNull(),
|
|
378
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
379
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
380
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
381
|
+
engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
|
|
382
|
+
enginePower: varchar('engine_power', { length: 255 }).notNull(),
|
|
383
|
+
tractionType: varchar('traction_type', { length: 255 }).notNull(),
|
|
384
|
+
bodyType: varchar('body_type', { length: 255 }).notNull(),
|
|
385
|
+
gearType: varchar('gear_type', { length: 255 }).notNull(),
|
|
386
|
+
fuelType: varchar('fuel_type', { length: 255 }).notNull(),
|
|
387
|
+
exchangeable: boolean('exchangeable'),
|
|
388
|
+
installments: boolean('installments'),
|
|
389
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
390
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
391
|
+
desc: longtext('desc'),
|
|
392
|
+
latitude: double('latitude'),
|
|
393
|
+
longitude: double('longitude'),
|
|
394
|
+
viewCount: int('view_count'),
|
|
395
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
|
|
396
|
+
}, (table) => [
|
|
397
|
+
index('title_index').on(table.title)
|
|
398
|
+
]);
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
export const CarsDbTable = mysqlTable('cars_db', {
|
|
402
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
403
|
+
name: varchar('name', { length: 255 }).notNull(),
|
|
404
|
+
parentId: int('parent_id'),
|
|
405
|
+
level: int('level')
|
|
406
|
+
}, (table) => [
|
|
407
|
+
index('cars_db_name_idx').on(table.name)
|
|
408
|
+
]);
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
export const BooksTable = mysqlTable('books', {
|
|
412
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
413
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
414
|
+
catId: int('cat_id').notNull(),
|
|
415
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
416
|
+
price: int('price').notNull(),
|
|
417
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
418
|
+
exchangeable: boolean('exchangeable'),
|
|
419
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
420
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
421
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
422
|
+
desc: longtext('desc'),
|
|
423
|
+
latitude: double('latitude'),
|
|
424
|
+
longitude: double('longitude'),
|
|
425
|
+
viewCount: int('view_count'),
|
|
426
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
427
|
+
govId: int('gov_id').notNull(),
|
|
428
|
+
districtId: int('district_id').notNull(),
|
|
429
|
+
subDistrictId: int('sub_district_id'),
|
|
430
|
+
townId: int('town_id')
|
|
431
|
+
}, (table) => [
|
|
432
|
+
index('title_index').on(table.title),
|
|
433
|
+
unique('title_unique').on(table.title)
|
|
434
|
+
]);
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
export const AddressTable = mysqlTable('address', {
|
|
438
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
439
|
+
catOrder: int('cat_order').notNull(),
|
|
440
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
441
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
442
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
443
|
+
image: varchar('image', { length: 255 }),
|
|
444
|
+
path: varchar('path', { length: 255 }),
|
|
445
|
+
parentId: int('parent_id'),
|
|
446
|
+
level: int('level')
|
|
447
|
+
});
|
|
448
|
+
|