create-nextjs-cms 0.9.0 → 0.9.1
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/LICENSE +21 -21
- package/README.md +71 -71
- package/dist/helpers/utils.js +16 -16
- package/dist/lib/section-creators.js +166 -166
- package/package.json +1 -1
- package/templates/default/.eslintrc.json +5 -5
- package/templates/default/.prettierignore +7 -7
- package/templates/default/.prettierrc.json +27 -27
- package/templates/default/CHANGELOG.md +140 -140
- package/templates/default/_gitignore +57 -57
- package/templates/default/app/(auth)/auth/login/LoginPage.tsx +192 -192
- package/templates/default/app/(auth)/auth/login/page.tsx +11 -11
- package/templates/default/app/(auth)/layout.tsx +81 -81
- package/templates/default/app/(rootLayout)/(plugins)/[...slug]/page.tsx +40 -40
- package/templates/default/app/(rootLayout)/(plugins)/[...slug]/plugin-server-registry.ts +16 -16
- package/templates/default/app/(rootLayout)/admins/page.tsx +10 -10
- package/templates/default/app/(rootLayout)/browse/[section]/[page]/page.tsx +22 -22
- package/templates/default/app/(rootLayout)/categorized/[section]/page.tsx +15 -15
- package/templates/default/app/(rootLayout)/dashboard/page.tsx +63 -63
- package/templates/default/app/(rootLayout)/dashboard-new/page.tsx +7 -7
- package/templates/default/app/(rootLayout)/edit/[section]/[itemId]/page.tsx +20 -20
- package/templates/default/app/(rootLayout)/layout.tsx +81 -81
- package/templates/default/app/(rootLayout)/loading.tsx +10 -10
- package/templates/default/app/(rootLayout)/log/page.tsx +7 -7
- package/templates/default/app/(rootLayout)/new/[section]/page.tsx +15 -15
- package/templates/default/app/(rootLayout)/section/[section]/page.tsx +19 -19
- package/templates/default/app/(rootLayout)/settings/page.tsx +13 -13
- package/templates/default/app/_trpc/client.ts +3 -3
- package/templates/default/app/api/auth/csrf/route.ts +25 -25
- package/templates/default/app/api/auth/refresh/route.ts +10 -10
- package/templates/default/app/api/auth/route.ts +49 -49
- package/templates/default/app/api/auth/session/route.ts +20 -20
- package/templates/default/app/api/document/route.ts +165 -165
- package/templates/default/app/api/editor/photo/route.ts +49 -49
- package/templates/default/app/api/photo/route.ts +27 -27
- package/templates/default/app/api/submit/section/item/[slug]/route.ts +95 -95
- package/templates/default/app/api/submit/section/item/route.ts +56 -56
- package/templates/default/app/api/submit/section/simple/route.ts +86 -86
- package/templates/default/app/api/trpc/[trpc]/route.ts +33 -33
- package/templates/default/app/api/video/route.ts +174 -174
- package/templates/default/app/globals.css +228 -228
- package/templates/default/app/providers.tsx +152 -152
- package/templates/default/cms.config.ts +57 -58
- package/templates/default/components/AdminCard.tsx +166 -166
- package/templates/default/components/AdminEditPage.tsx +124 -124
- package/templates/default/components/AdminPrivilegeCard.tsx +185 -185
- package/templates/default/components/AdminsPage.tsx +43 -43
- package/templates/default/components/AnalyticsPage.tsx +128 -128
- package/templates/default/components/BarChartBox.tsx +42 -42
- package/templates/default/components/BrowsePage.tsx +106 -106
- package/templates/default/components/CategorizedSectionPage.tsx +31 -31
- package/templates/default/components/CategoryDeleteConfirmPage.tsx +130 -130
- package/templates/default/components/CategorySectionSelectInput.tsx +140 -140
- package/templates/default/components/ConditionalFields.tsx +49 -49
- package/templates/default/components/ContainerBox.tsx +24 -24
- package/templates/default/components/DashboardNewPage.tsx +253 -253
- package/templates/default/components/DashboardPage.tsx +188 -188
- package/templates/default/components/DashboardPageAlt.tsx +45 -45
- package/templates/default/components/DefaultNavItems.tsx +3 -3
- package/templates/default/components/Dropzone.tsx +154 -154
- package/templates/default/components/EmailCard.tsx +138 -138
- package/templates/default/components/EmailPasswordForm.tsx +85 -85
- package/templates/default/components/EmailQuotaForm.tsx +73 -73
- package/templates/default/components/EmailsPage.tsx +49 -49
- package/templates/default/components/ErrorComponent.tsx +16 -16
- package/templates/default/components/GalleryPhoto.tsx +93 -93
- package/templates/default/components/InfoCard.tsx +93 -93
- package/templates/default/components/ItemEditPage.tsx +294 -294
- package/templates/default/components/Layout.tsx +84 -84
- package/templates/default/components/LoadingSpinners.tsx +67 -67
- package/templates/default/components/LocaleSwitcher.tsx +89 -89
- package/templates/default/components/LogPage.tsx +107 -107
- package/templates/default/components/Modal.tsx +166 -166
- package/templates/default/components/Navbar.tsx +258 -258
- package/templates/default/components/NewAdminForm.tsx +173 -173
- package/templates/default/components/NewEmailForm.tsx +132 -132
- package/templates/default/components/NewPage.tsx +206 -206
- package/templates/default/components/NewVariantComponent.tsx +229 -229
- package/templates/default/components/PhotoGallery.tsx +35 -35
- package/templates/default/components/PieChartBox.tsx +101 -101
- package/templates/default/components/ProgressBar.tsx +48 -48
- package/templates/default/components/ProtectedDocument.tsx +44 -44
- package/templates/default/components/ProtectedImage.tsx +143 -143
- package/templates/default/components/ProtectedVideo.tsx +76 -76
- package/templates/default/components/SectionIcon.tsx +8 -8
- package/templates/default/components/SectionItemCard.tsx +144 -144
- package/templates/default/components/SectionItemStatusBadge.tsx +17 -17
- package/templates/default/components/SectionPage.tsx +205 -205
- package/templates/default/components/SelectBox.tsx +98 -98
- package/templates/default/components/SelectInputButtons.tsx +125 -125
- package/templates/default/components/SettingsPage.tsx +232 -232
- package/templates/default/components/Sidebar.tsx +204 -204
- package/templates/default/components/SidebarDropdownItem.tsx +83 -83
- package/templates/default/components/SidebarItem.tsx +24 -24
- package/templates/default/components/ThemeProvider.tsx +8 -8
- package/templates/default/components/TooltipComponent.tsx +27 -27
- package/templates/default/components/VariantCard.tsx +124 -124
- package/templates/default/components/VariantEditPage.tsx +230 -230
- package/templates/default/components/analytics/BounceRate.tsx +70 -70
- package/templates/default/components/analytics/LivePageViews.tsx +55 -55
- package/templates/default/components/analytics/LiveUsersCount.tsx +33 -33
- package/templates/default/components/analytics/MonthlyPageViews.tsx +42 -42
- package/templates/default/components/analytics/TopCountries.tsx +52 -52
- package/templates/default/components/analytics/TopDevices.tsx +46 -46
- package/templates/default/components/analytics/TopMediums.tsx +58 -58
- package/templates/default/components/analytics/TopSources.tsx +45 -45
- package/templates/default/components/analytics/TotalPageViews.tsx +41 -41
- package/templates/default/components/analytics/TotalSessions.tsx +41 -41
- package/templates/default/components/analytics/TotalUniqueUsers.tsx +41 -41
- package/templates/default/components/custom/RightHomeRoomVariantCard.tsx +138 -138
- package/templates/default/components/dndKit/Draggable.tsx +21 -21
- package/templates/default/components/dndKit/Droppable.tsx +20 -20
- package/templates/default/components/dndKit/SortableItem.tsx +18 -18
- package/templates/default/components/form/DateRangeFormInput.tsx +57 -57
- package/templates/default/components/form/Form.tsx +360 -360
- package/templates/default/components/form/FormInputElement.tsx +70 -70
- package/templates/default/components/form/FormInputs.tsx +111 -111
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/components/form/helpers/util.ts +17 -17
- package/templates/default/components/form/inputs/CheckboxFormInput.tsx +46 -46
- package/templates/default/components/form/inputs/ColorFormInput.tsx +44 -44
- package/templates/default/components/form/inputs/DateFormInput.tsx +156 -156
- package/templates/default/components/form/inputs/DocumentFormInput.tsx +222 -222
- package/templates/default/components/form/inputs/MapFormInput.tsx +140 -140
- package/templates/default/components/form/inputs/MultipleSelectFormInput.tsx +85 -85
- package/templates/default/components/form/inputs/NumberFormInput.tsx +43 -43
- package/templates/default/components/form/inputs/PasswordFormInput.tsx +47 -47
- package/templates/default/components/form/inputs/PhotoFormInput.tsx +275 -275
- package/templates/default/components/form/inputs/RichTextFormInput.tsx +138 -138
- package/templates/default/components/form/inputs/SelectFormInput.tsx +175 -175
- package/templates/default/components/form/inputs/SlugFormInput.tsx +131 -131
- package/templates/default/components/form/inputs/TagsFormInput.tsx +260 -260
- package/templates/default/components/form/inputs/TextFormInput.tsx +51 -51
- package/templates/default/components/form/inputs/TextareaFormInput.tsx +50 -50
- package/templates/default/components/form/inputs/VideoFormInput.tsx +118 -118
- package/templates/default/components/multi-select.tsx +1146 -1146
- package/templates/default/components/pagination/Pagination.tsx +36 -36
- package/templates/default/components/pagination/PaginationButtons.tsx +147 -147
- package/templates/default/components/theme-toggle.tsx +39 -39
- package/templates/default/components/ui/accordion.tsx +53 -53
- package/templates/default/components/ui/alert-dialog.tsx +157 -157
- package/templates/default/components/ui/alert.tsx +47 -47
- package/templates/default/components/ui/badge.tsx +38 -38
- package/templates/default/components/ui/button.tsx +62 -62
- package/templates/default/components/ui/calendar.tsx +166 -166
- package/templates/default/components/ui/card.tsx +43 -43
- package/templates/default/components/ui/checkbox.tsx +29 -29
- package/templates/default/components/ui/command.tsx +137 -137
- package/templates/default/components/ui/custom-alert-dialog.tsx +113 -113
- package/templates/default/components/ui/custom-dialog.tsx +123 -123
- package/templates/default/components/ui/dialog.tsx +123 -123
- package/templates/default/components/ui/direction.tsx +22 -22
- package/templates/default/components/ui/dropdown-menu.tsx +182 -182
- package/templates/default/components/ui/input-group.tsx +54 -54
- package/templates/default/components/ui/input.tsx +22 -22
- package/templates/default/components/ui/label.tsx +19 -19
- package/templates/default/components/ui/popover.tsx +42 -42
- package/templates/default/components/ui/progress.tsx +31 -31
- package/templates/default/components/ui/scroll-area.tsx +42 -42
- package/templates/default/components/ui/select.tsx +165 -165
- package/templates/default/components/ui/separator.tsx +28 -28
- package/templates/default/components/ui/sheet.tsx +103 -103
- package/templates/default/components/ui/spinner.tsx +16 -16
- package/templates/default/components/ui/switch.tsx +29 -29
- package/templates/default/components/ui/table.tsx +83 -83
- package/templates/default/components/ui/tabs.tsx +55 -55
- package/templates/default/components/ui/toast.tsx +113 -113
- package/templates/default/components/ui/toaster.tsx +35 -35
- package/templates/default/components/ui/tooltip.tsx +30 -30
- package/templates/default/components/ui/use-toast.ts +188 -188
- package/templates/default/components.json +21 -21
- package/templates/default/context/ModalProvider.tsx +53 -53
- package/templates/default/drizzle.config.ts +4 -4
- package/templates/default/dynamic-schemas/schema.ts +475 -474
- package/templates/default/env/env.js +130 -130
- package/templates/default/envConfig.ts +4 -4
- package/templates/default/hooks/useModal.ts +8 -8
- package/templates/default/lib/apiHelpers.ts +92 -92
- package/templates/default/lib/postinstall.js +14 -14
- package/templates/default/lib/utils.ts +6 -6
- package/templates/default/next-env.d.ts +6 -6
- package/templates/default/next.config.ts +23 -23
- package/templates/default/package.json +1 -1
- package/templates/default/postcss.config.mjs +6 -6
- package/templates/default/proxy.ts +32 -32
- package/templates/default/tsconfig.json +48 -48
|
@@ -1,474 +1,475 @@
|
|
|
1
|
-
import {mysqlTable,int,longtext,mysqlEnum,varchar,index,unique,primaryKey,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
|
-
photo: varchar('photo', { length: 255 }),
|
|
38
|
-
category: varchar('category', { length: 255 })
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
unique('
|
|
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
|
-
unique('
|
|
82
|
-
unique('
|
|
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
|
-
unique('
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
unique('
|
|
299
|
-
unique('
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
1
|
+
import {mysqlTable,int,longtext,mysqlEnum,varchar,index,unique,primaryKey,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
|
+
photo: varchar('photo', { length: 255 }),
|
|
38
|
+
category: varchar('category', { length: 255 }),
|
|
39
|
+
file: varchar('file', { length: 255 }).notNull()
|
|
40
|
+
}, (table) => [
|
|
41
|
+
index('unique_user_report_index').on(table.contentType, table.price, table.appId),
|
|
42
|
+
unique('unique_user_report').on(table.contentType, table.price, table.appId),
|
|
43
|
+
unique('price_unique').on(table.price)
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export const TestTagsTable = mysqlTable('test_tags', {
|
|
48
|
+
testId: varchar('test_id', { length: 255 }).notNull(),
|
|
49
|
+
tagName: varchar('tag_name', { length: 255 }).notNull(),
|
|
50
|
+
locale: varchar('locale', { length: 255 })
|
|
51
|
+
}, (table) => [
|
|
52
|
+
primaryKey({ columns: [table.testId, table.tagName, table.locale] })
|
|
53
|
+
]);
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
export const TestSectionLocalesTable = mysqlTable('test_section_locales', {
|
|
57
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
58
|
+
parentId: int('parent_id').notNull(),
|
|
59
|
+
locale: varchar('locale', { length: 10 }).notNull(),
|
|
60
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
61
|
+
price: int('price'),
|
|
62
|
+
appId: varchar('app_id', { length: 36 }).notNull(),
|
|
63
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
64
|
+
photo: varchar('photo', { length: 255 }),
|
|
65
|
+
category: varchar('category', { length: 255 })
|
|
66
|
+
}, (table) => [
|
|
67
|
+
unique('test_section_locales_parent_id_locale_unique').on(table.parentId, table.locale)
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
export const FeaturedSliderTable = mysqlTable('featured_slider', {
|
|
72
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
73
|
+
image: varchar('image', { length: 255 }).notNull(),
|
|
74
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
75
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
76
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
77
|
+
descEn: longtext('desc_en').notNull(),
|
|
78
|
+
descAr: longtext('desc_ar').notNull(),
|
|
79
|
+
descTr: longtext('desc_tr').notNull()
|
|
80
|
+
}, (table) => [
|
|
81
|
+
unique('title_en_unique').on(table.titleEn),
|
|
82
|
+
unique('title_ar_unique').on(table.titleAr),
|
|
83
|
+
unique('title_tr_unique').on(table.titleTr)
|
|
84
|
+
]);
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
export const MenuSettingsTable = mysqlTable('menu_settings', {
|
|
88
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
89
|
+
taxRate: varchar('tax_rate', { length: 255 }),
|
|
90
|
+
hideSlider: boolean('hide_slider')
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
export const ServicesTable = mysqlTable('services', {
|
|
95
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
96
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
97
|
+
catId: int('cat_id').notNull(),
|
|
98
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
99
|
+
price: int('price'),
|
|
100
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']),
|
|
101
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
102
|
+
desc: longtext('desc'),
|
|
103
|
+
latitude: double('latitude'),
|
|
104
|
+
longitude: double('longitude'),
|
|
105
|
+
viewCount: int('view_count'),
|
|
106
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
107
|
+
govId: int('gov_id').notNull(),
|
|
108
|
+
districtId: int('district_id').notNull(),
|
|
109
|
+
subDistrictId: int('sub_district_id'),
|
|
110
|
+
townId: int('town_id')
|
|
111
|
+
}, (table) => [
|
|
112
|
+
index('title_index').on(table.title),
|
|
113
|
+
unique('title_unique').on(table.title)
|
|
114
|
+
]);
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
export const RealestateTable = mysqlTable('realestate', {
|
|
118
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
119
|
+
catId: int('cat_id').notNull(),
|
|
120
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
121
|
+
price: int('price').notNull(),
|
|
122
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
123
|
+
spaceGross: int('space_gross').notNull(),
|
|
124
|
+
spaceNet: int('space_net').notNull(),
|
|
125
|
+
latitude: double('latitude').notNull(),
|
|
126
|
+
longitude: double('longitude').notNull(),
|
|
127
|
+
roomCount: varchar('room_count', { length: 255 }),
|
|
128
|
+
buildingAge: varchar('building_age', { length: 255 }),
|
|
129
|
+
floorCount: varchar('floor_count', { length: 255 }),
|
|
130
|
+
bathroomCount: varchar('bathroom_count', { length: 255 }),
|
|
131
|
+
floorLocation: varchar('floor_location', { length: 255 }),
|
|
132
|
+
heatingType: varchar('heating_type', { length: 255 }),
|
|
133
|
+
kitchenType: varchar('kitchen_type', { length: 255 }),
|
|
134
|
+
balcony: boolean('balcony'),
|
|
135
|
+
lift: boolean('lift'),
|
|
136
|
+
parkingType: varchar('parking_type', { length: 255 }),
|
|
137
|
+
furnished: boolean('furnished'),
|
|
138
|
+
belongsToSite: boolean('belongs_to_site'),
|
|
139
|
+
siteName: varchar('site_name', { length: 255 }),
|
|
140
|
+
installments: boolean('installments'),
|
|
141
|
+
exchangeable: boolean('exchangeable'),
|
|
142
|
+
fromWhom: varchar('from_whom', { length: 255 }),
|
|
143
|
+
buildingMembershipFees: int('building_membership_fees'),
|
|
144
|
+
deposit: int('deposit'),
|
|
145
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
146
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
147
|
+
desc: longtext('desc'),
|
|
148
|
+
viewCount: int('view_count'),
|
|
149
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
150
|
+
govId: int('gov_id').notNull(),
|
|
151
|
+
districtId: int('district_id').notNull(),
|
|
152
|
+
subDistrictId: int('sub_district_id'),
|
|
153
|
+
townId: int('town_id')
|
|
154
|
+
}, (table) => [
|
|
155
|
+
index('title_index').on(table.title),
|
|
156
|
+
unique('title_unique').on(table.title)
|
|
157
|
+
]);
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
export const HomepageSliderTable = mysqlTable('homepage_slider', {
|
|
161
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
162
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
163
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
164
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
165
|
+
subtitleEn: varchar('subtitle_en', { length: 255 }).notNull(),
|
|
166
|
+
subtitleAr: varchar('subtitle_ar', { length: 255 }).notNull(),
|
|
167
|
+
subtitleTr: varchar('subtitle_tr', { length: 255 }).notNull(),
|
|
168
|
+
photo: varchar('photo', { length: 255 }).notNull(),
|
|
169
|
+
buttonUrl: varchar('button_url', { length: 255 }),
|
|
170
|
+
buttonTextEn: varchar('button_text_en', { length: 255 }),
|
|
171
|
+
buttonTextAr: varchar('button_text_ar', { length: 255 }),
|
|
172
|
+
buttonTextTr: varchar('button_text_tr', { length: 255 }),
|
|
173
|
+
buttonUrlTarget: mysqlEnum('button_url_target', ['_blank', '_self'])
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
export const ContestSubscribersTable = mysqlTable('contest_subscribers', {
|
|
178
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
179
|
+
userId: int('user_id').notNull(),
|
|
180
|
+
contestId: varchar('contest_id', { length: 255 }).notNull()
|
|
181
|
+
}, (table) => [
|
|
182
|
+
unique('contest_subscriber_unique').on(table.contestId, table.userId)
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
export const ContestsTable = mysqlTable('contests', {
|
|
187
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
188
|
+
date: timestamp('date').notNull(),
|
|
189
|
+
prize: varchar('prize', { length: 255 }).notNull(),
|
|
190
|
+
winnerId: int('winner_id'),
|
|
191
|
+
tags: varchar('tags', { length: 255 })
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
export const NotificationsTable = mysqlTable('notifications', {
|
|
196
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
197
|
+
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(),
|
|
198
|
+
contentId: int('content_id'),
|
|
199
|
+
contentCatId: int('content_cat_id'),
|
|
200
|
+
userId: int('user_id'),
|
|
201
|
+
message: varchar('message', { length: 255 })
|
|
202
|
+
}, (table) => [
|
|
203
|
+
index('type_index').on(table.type),
|
|
204
|
+
unique('unique_notification').on(table.type, table.contentId, table.contentCatId)
|
|
205
|
+
]);
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
export const ModerationTable = mysqlTable('moderation', {
|
|
209
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
210
|
+
contentType: mysqlEnum('content_type', ['ad', 'user']).notNull(),
|
|
211
|
+
contentId: int('content_id').notNull(),
|
|
212
|
+
catId: int('cat_id'),
|
|
213
|
+
userId: int('user_id').notNull(),
|
|
214
|
+
flagged: int('flagged').notNull(),
|
|
215
|
+
result: varchar('result', { length: 255 }).notNull()
|
|
216
|
+
}, (table) => [
|
|
217
|
+
index('unique_user_report_index').on(table.contentType, table.contentId, table.catId, table.userId),
|
|
218
|
+
unique('unique_user_report').on(table.contentType, table.contentId, table.catId, table.userId)
|
|
219
|
+
]);
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
export const JobsTable = mysqlTable('jobs', {
|
|
223
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
224
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
225
|
+
catId: int('cat_id').notNull(),
|
|
226
|
+
salary: int('salary'),
|
|
227
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
228
|
+
workMethod: varchar('work_method', { length: 255 }).notNull(),
|
|
229
|
+
minimumEducation: varchar('minimum_education', { length: 255 }).notNull(),
|
|
230
|
+
experienceLevel: varchar('experience_level', { length: 255 }).notNull(),
|
|
231
|
+
remote: boolean('remote'),
|
|
232
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
233
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
234
|
+
desc: longtext('desc'),
|
|
235
|
+
latitude: double('latitude'),
|
|
236
|
+
longitude: double('longitude'),
|
|
237
|
+
viewCount: int('view_count'),
|
|
238
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
239
|
+
govId: int('gov_id').notNull(),
|
|
240
|
+
districtId: int('district_id').notNull(),
|
|
241
|
+
subDistrictId: int('sub_district_id'),
|
|
242
|
+
townId: int('town_id')
|
|
243
|
+
}, (table) => [
|
|
244
|
+
index('title_index').on(table.title),
|
|
245
|
+
unique('title_unique').on(table.title)
|
|
246
|
+
]);
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
export const FurnitureTable = mysqlTable('furniture', {
|
|
250
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
251
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
252
|
+
catId: int('cat_id').notNull(),
|
|
253
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
254
|
+
price: int('price').notNull(),
|
|
255
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
256
|
+
exchangeable: boolean('exchangeable'),
|
|
257
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
258
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
259
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
260
|
+
desc: longtext('desc'),
|
|
261
|
+
latitude: double('latitude'),
|
|
262
|
+
longitude: double('longitude'),
|
|
263
|
+
viewCount: int('view_count'),
|
|
264
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
265
|
+
govId: int('gov_id').notNull(),
|
|
266
|
+
districtId: int('district_id').notNull(),
|
|
267
|
+
subDistrictId: int('sub_district_id'),
|
|
268
|
+
townId: int('town_id')
|
|
269
|
+
}, (table) => [
|
|
270
|
+
index('title_index').on(table.title),
|
|
271
|
+
unique('title_unique').on(table.title)
|
|
272
|
+
]);
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
export const FiltersTable = mysqlTable('filters', {
|
|
276
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
277
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
278
|
+
Key: varchar('_key', { length: 255 }).notNull(),
|
|
279
|
+
fieldName: varchar('field_name', { length: 255 }).notNull(),
|
|
280
|
+
type: mysqlEnum('type', ['checkbox', 'select', 'text', 'finance', 'number', 'point']).notNull(),
|
|
281
|
+
tableName: varchar('table_name', { length: 255 }),
|
|
282
|
+
isMandatory: boolean('is_mandatory')
|
|
283
|
+
}, (table) => [
|
|
284
|
+
unique('title_unique').on(table.title),
|
|
285
|
+
unique('key_unique').on(table.Key)
|
|
286
|
+
]);
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
export const FaqTable = mysqlTable('faq', {
|
|
290
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
291
|
+
qEn: varchar('q_en', { length: 255 }).notNull(),
|
|
292
|
+
qAr: varchar('q_ar', { length: 255 }).notNull(),
|
|
293
|
+
qTr: varchar('q_tr', { length: 255 }),
|
|
294
|
+
aEn: longtext('a_en').notNull(),
|
|
295
|
+
aAr: longtext('a_ar'),
|
|
296
|
+
aTr: longtext('a_tr')
|
|
297
|
+
}, (table) => [
|
|
298
|
+
unique('faq_q_en_unique').on(table.qEn),
|
|
299
|
+
unique('title_ar_unique').on(table.qAr),
|
|
300
|
+
unique('title_tr_unique').on(table.qTr)
|
|
301
|
+
]);
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
export const ErrorsTable = mysqlTable('errors', {
|
|
305
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
306
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
307
|
+
caseId: varchar('case_id', { length: 255 }).notNull(),
|
|
308
|
+
userId: int('user_id'),
|
|
309
|
+
itemSlug: varchar('item_slug', { length: 255 }),
|
|
310
|
+
desc: longtext('desc'),
|
|
311
|
+
isResolved: boolean('is_resolved')
|
|
312
|
+
}, (table) => [
|
|
313
|
+
unique('key_unique').on(table.caseId)
|
|
314
|
+
]);
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
export const ElectronicsTable = mysqlTable('electronics', {
|
|
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
|
+
installments: boolean('installments'),
|
|
326
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
327
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
328
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
329
|
+
desc: longtext('desc'),
|
|
330
|
+
latitude: double('latitude'),
|
|
331
|
+
longitude: double('longitude'),
|
|
332
|
+
viewCount: int('view_count'),
|
|
333
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
334
|
+
govId: int('gov_id').notNull(),
|
|
335
|
+
districtId: int('district_id').notNull(),
|
|
336
|
+
subDistrictId: int('sub_district_id'),
|
|
337
|
+
townId: int('town_id')
|
|
338
|
+
}, (table) => [
|
|
339
|
+
index('title_index').on(table.title),
|
|
340
|
+
unique('title_unique').on(table.title)
|
|
341
|
+
]);
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
export const ClothesTable = mysqlTable('clothes', {
|
|
345
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
346
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
347
|
+
catId: int('cat_id').notNull(),
|
|
348
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
349
|
+
price: int('price').notNull(),
|
|
350
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
351
|
+
exchangeable: boolean('exchangeable'),
|
|
352
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
353
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
354
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
355
|
+
desc: longtext('desc'),
|
|
356
|
+
latitude: double('latitude'),
|
|
357
|
+
longitude: double('longitude'),
|
|
358
|
+
viewCount: int('view_count'),
|
|
359
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
360
|
+
govId: int('gov_id').notNull(),
|
|
361
|
+
districtId: int('district_id').notNull(),
|
|
362
|
+
subDistrictId: int('sub_district_id'),
|
|
363
|
+
townId: int('town_id')
|
|
364
|
+
}, (table) => [
|
|
365
|
+
index('title_index').on(table.title),
|
|
366
|
+
unique('title_unique').on(table.title)
|
|
367
|
+
]);
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
export const CatsTable = mysqlTable('cats', {
|
|
371
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
372
|
+
catOrder: int('cat_order').notNull(),
|
|
373
|
+
slug: varchar('slug', { length: 255 }).notNull(),
|
|
374
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
375
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
376
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
377
|
+
fullTitleEn: varchar('full_title_en', { length: 255 }),
|
|
378
|
+
fullTitleAr: varchar('full_title_ar', { length: 255 }),
|
|
379
|
+
fullTitleTr: varchar('full_title_tr', { length: 255 }),
|
|
380
|
+
image: varchar('image', { length: 255 }),
|
|
381
|
+
metaDescEn: varchar('meta_desc_en', { length: 255 }),
|
|
382
|
+
metaDescAr: varchar('meta_desc_ar', { length: 255 }),
|
|
383
|
+
metaDescTr: varchar('meta_desc_tr', { length: 255 }),
|
|
384
|
+
filters: varchar('filters', { length: 255 }),
|
|
385
|
+
tableName: varchar('table_name', { length: 255 }).notNull(),
|
|
386
|
+
adCount: int('ad_count'),
|
|
387
|
+
parentId: int('parent_id'),
|
|
388
|
+
level: int('level')
|
|
389
|
+
}, (table) => [
|
|
390
|
+
unique('cats_slug_unique').on(table.slug)
|
|
391
|
+
]);
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
export const CarsTable = mysqlTable('cars', {
|
|
395
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
396
|
+
modelYear: int('model_year').notNull(),
|
|
397
|
+
model: varchar('model', { length: 255 }).notNull(),
|
|
398
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
399
|
+
catId: int('cat_id').notNull(),
|
|
400
|
+
govId: int('gov_id').notNull(),
|
|
401
|
+
districtId: int('district_id').notNull(),
|
|
402
|
+
subDistrictId: int('sub_district_id'),
|
|
403
|
+
townId: int('town_id'),
|
|
404
|
+
price: int('price').notNull(),
|
|
405
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
406
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
407
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
408
|
+
engineCapacity: varchar('engine_capacity', { length: 255 }).notNull(),
|
|
409
|
+
enginePower: varchar('engine_power', { length: 255 }).notNull(),
|
|
410
|
+
tractionType: varchar('traction_type', { length: 255 }).notNull(),
|
|
411
|
+
bodyType: varchar('body_type', { length: 255 }).notNull(),
|
|
412
|
+
gearType: varchar('gear_type', { length: 255 }).notNull(),
|
|
413
|
+
fuelType: varchar('fuel_type', { length: 255 }).notNull(),
|
|
414
|
+
exchangeable: boolean('exchangeable'),
|
|
415
|
+
installments: boolean('installments'),
|
|
416
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
417
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
418
|
+
desc: longtext('desc'),
|
|
419
|
+
latitude: double('latitude'),
|
|
420
|
+
longitude: double('longitude'),
|
|
421
|
+
viewCount: int('view_count'),
|
|
422
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired'])
|
|
423
|
+
}, (table) => [
|
|
424
|
+
index('title_index').on(table.title)
|
|
425
|
+
]);
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
export const CarsDbTable = mysqlTable('cars_db', {
|
|
429
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
430
|
+
name: varchar('name', { length: 255 }).notNull(),
|
|
431
|
+
parentId: int('parent_id'),
|
|
432
|
+
level: int('level')
|
|
433
|
+
}, (table) => [
|
|
434
|
+
index('cars_db_name_idx').on(table.name)
|
|
435
|
+
]);
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
export const BooksTable = mysqlTable('books', {
|
|
439
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
440
|
+
title: varchar('title', { length: 255 }).notNull(),
|
|
441
|
+
catId: int('cat_id').notNull(),
|
|
442
|
+
condition: varchar('condition', { length: 255 }).notNull(),
|
|
443
|
+
price: int('price').notNull(),
|
|
444
|
+
currency: mysqlEnum('currency', ['USD', 'TRY', 'SYP']).notNull(),
|
|
445
|
+
exchangeable: boolean('exchangeable'),
|
|
446
|
+
fromWhom: varchar('from_whom', { length: 255 }).notNull(),
|
|
447
|
+
coverphoto: varchar('coverphoto', { length: 255 }).notNull(),
|
|
448
|
+
coverphotoPlaceholder: varchar('coverphoto_placeholder', { length: 255 }),
|
|
449
|
+
desc: longtext('desc'),
|
|
450
|
+
latitude: double('latitude'),
|
|
451
|
+
longitude: double('longitude'),
|
|
452
|
+
viewCount: int('view_count'),
|
|
453
|
+
status: mysqlEnum('status', ['pending_creation', 'active', 'pending_review', 'rejected', 'expired']),
|
|
454
|
+
govId: int('gov_id').notNull(),
|
|
455
|
+
districtId: int('district_id').notNull(),
|
|
456
|
+
subDistrictId: int('sub_district_id'),
|
|
457
|
+
townId: int('town_id')
|
|
458
|
+
}, (table) => [
|
|
459
|
+
index('title_index').on(table.title),
|
|
460
|
+
unique('title_unique').on(table.title)
|
|
461
|
+
]);
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
export const AddressTable = mysqlTable('address', {
|
|
465
|
+
id: int('id').autoincrement().notNull().primaryKey(),
|
|
466
|
+
catOrder: int('cat_order').notNull(),
|
|
467
|
+
titleEn: varchar('title_en', { length: 255 }).notNull(),
|
|
468
|
+
titleAr: varchar('title_ar', { length: 255 }).notNull(),
|
|
469
|
+
titleTr: varchar('title_tr', { length: 255 }).notNull(),
|
|
470
|
+
image: varchar('image', { length: 255 }),
|
|
471
|
+
path: varchar('path', { length: 255 }),
|
|
472
|
+
parentId: int('parent_id'),
|
|
473
|
+
level: int('level')
|
|
474
|
+
});
|
|
475
|
+
|