-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremote_schemas.txt
More file actions
420 lines (396 loc) · 11.3 KB
/
Copy pathremote_schemas.txt
File metadata and controls
420 lines (396 loc) · 11.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
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
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
=== businesses ===
CREATE TABLE businesses (
id TEXT PRIMARY KEY NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
owner_id TEXT NOT NULL,
category_id TEXT,
status TEXT DEFAULT 'draft',
banner_image_id TEXT,
profile_image_id TEXT,
contact_name TEXT,
contact_number TEXT,
country_code TEXT DEFAULT '+670',
year_of_establishment INTEGER,
email TEXT,
address TEXT,
location_lat REAL,
location_lng REAL,
opening_hours TEXT,
about_us TEXT,
latest_updates TEXT,
tags TEXT,
likes INTEGER DEFAULT 0,
saves INTEGER DEFAULT 0,
views INTEGER DEFAULT 0,
rating_average REAL DEFAULT 0,
rating_count INTEGER DEFAULT 0,
shares INTEGER DEFAULT 0,
plan_type TEXT,
publish_date INTEGER,
expiry_date INTEGER,
subscription_status TEXT DEFAULT 'none',
subscription_expires_at INTEGER,
grace_period_end_date INTEGER,
limits TEXT,
plan_slug TEXT,
verified_badge INTEGER DEFAULT 0,
social_links TEXT,
photo_gallery TEXT,
organization_type TEXT,
deleted_at INTEGER,
created_at INTEGER,
updated_at INTEGER
, latest_update TEXT, latest_update_images TEXT, latest_update_date INTEGER, registration_url TEXT, plan_expires_at INTEGER, grace_period_end_at INTEGER)
=== non_profits ===
CREATE TABLE non_profits (
id TEXT PRIMARY KEY NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
owner_id TEXT NOT NULL,
category_id TEXT,
status TEXT DEFAULT 'draft',
banner_image_id TEXT,
profile_image_id TEXT,
contact_name TEXT,
contact_number TEXT,
country_code TEXT DEFAULT '+670',
year_of_establishment INTEGER,
email TEXT,
address TEXT,
location_lat REAL,
location_lng REAL,
opening_hours TEXT,
about_us TEXT,
latest_updates TEXT,
tags TEXT,
likes INTEGER DEFAULT 0,
saves INTEGER DEFAULT 0,
views INTEGER DEFAULT 0,
shares INTEGER DEFAULT 0,
photo_gallery TEXT,
latest_update TEXT,
latest_update_images TEXT,
latest_update_date INTEGER,
registration_url TEXT,
verified_badge INTEGER DEFAULT 0,
social_links TEXT,
deleted_at INTEGER,
created_at INTEGER,
updated_at INTEGER
, rating_average REAL DEFAULT 0, rating_count INTEGER DEFAULT 0, trial_started_at INTEGER, grace_period_end_date INTEGER, subscription_status TEXT DEFAULT 'none', subscription_expires_at INTEGER)
=== public_sectors ===
CREATE TABLE public_sectors (
id TEXT PRIMARY KEY NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
owner_id TEXT NOT NULL,
category_id TEXT,
status TEXT DEFAULT 'draft',
banner_image_id TEXT,
profile_image_id TEXT,
contact_name TEXT,
contact_number TEXT,
country_code TEXT DEFAULT '+670',
year_of_establishment INTEGER,
email TEXT,
address TEXT,
location_lat REAL,
location_lng REAL,
opening_hours TEXT,
about_us TEXT,
latest_updates TEXT,
tags TEXT,
likes INTEGER DEFAULT 0,
saves INTEGER DEFAULT 0,
views INTEGER DEFAULT 0,
shares INTEGER DEFAULT 0,
photo_gallery TEXT,
latest_update TEXT,
latest_update_images TEXT,
latest_update_date INTEGER,
government_data TEXT,
registration_url TEXT,
verified_badge INTEGER DEFAULT 0,
social_links TEXT,
deleted_at INTEGER,
created_at INTEGER,
updated_at INTEGER
, rating_average REAL DEFAULT 0, rating_count INTEGER DEFAULT 0, trial_started_at INTEGER, grace_period_end_date INTEGER, subscription_status TEXT DEFAULT 'none', subscription_expires_at INTEGER, plan_type TEXT, publish_date INTEGER, expiry_date INTEGER)
=== listings ===
CREATE TABLE listings (
id TEXT PRIMARY KEY NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
owner_id TEXT NOT NULL,
category_id TEXT,
status TEXT DEFAULT 'draft',
listing_type TEXT NOT NULL DEFAULT 'product',
description TEXT NOT NULL,
price TEXT,
condition TEXT,
location TEXT,
location_lat REAL,
location_lng REAL,
contact_name TEXT,
contact_number TEXT,
country_code TEXT DEFAULT '+670',
email TEXT,
image_ids TEXT,
tags TEXT,
likes INTEGER DEFAULT 0,
saves INTEGER DEFAULT 0,
views INTEGER DEFAULT 0,
shares INTEGER DEFAULT 0,
last_renewed_at INTEGER,
featured INTEGER DEFAULT 0,
featured_until INTEGER,
extra_data TEXT,
created_at INTEGER,
updated_at INTEGER
, expires_at INTEGER, plan_expires_at INTEGER, address TEXT, grace_period_end_at INTEGER)
=== products ===
CREATE TABLE products (
id TEXT PRIMARY KEY NOT NULL,
business_id TEXT NOT NULL,
category_id TEXT NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
product_type TEXT DEFAULT 'product',
price_fields TEXT,
specifications TEXT,
images TEXT DEFAULT '[]',
featured INTEGER DEFAULT 0,
active INTEGER DEFAULT 1,
sort_order INTEGER DEFAULT 0,
views INTEGER DEFAULT 0,
likes INTEGER DEFAULT 0,
saves INTEGER DEFAULT 0,
shares INTEGER DEFAULT 0,
deleted_at INTEGER,
created_at INTEGER,
updated_at INTEGER
)
=== media ===
CREATE TABLE media (
id TEXT PRIMARY KEY NOT NULL,
r2_key TEXT NOT NULL UNIQUE,
filename TEXT NOT NULL,
mime_type TEXT NOT NULL,
size INTEGER NOT NULL,
width INTEGER,
height INTEGER,
entity_type TEXT NOT NULL,
entity_id TEXT NOT NULL,
purpose TEXT NOT NULL,
sort_order INTEGER DEFAULT 0,
alt TEXT,
hash TEXT UNIQUE,
created_by_id TEXT,
created_at INTEGER,
deleted_at INTEGER
)
=== orders ===
CREATE TABLE orders (
id TEXT PRIMARY KEY NOT NULL,
service_package_id TEXT,
variant_snapshot TEXT NOT NULL,
type TEXT NOT NULL,
type_id TEXT,
user_id TEXT NOT NULL,
amount INTEGER NOT NULL,
status TEXT DEFAULT 'pending',
payment_method TEXT,
paid_date INTEGER,
expires_at INTEGER,
admin_notes TEXT,
created_at INTEGER,
updated_at INTEGER
)
=== service_packages ===
CREATE TABLE service_packages (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
service_type TEXT NOT NULL,
service_relation_to TEXT,
description TEXT,
variants TEXT NOT NULL,
is_active INTEGER DEFAULT 1,
sort_order INTEGER DEFAULT 0,
created_at INTEGER,
updated_at INTEGER
)
=== ad_banners ===
CREATE TABLE ad_banners (
id TEXT PRIMARY KEY NOT NULL,
title TEXT NOT NULL,
description TEXT,
image_id TEXT,
link_url TEXT,
link_type TEXT NOT NULL,
position TEXT NOT NULL,
sort_order INTEGER DEFAULT 0,
order_id TEXT,
is_active INTEGER DEFAULT 1,
start_date INTEGER,
end_date INTEGER,
created_at INTEGER,
updated_at INTEGER
)
=== blog_posts ===
CREATE TABLE blog_posts (
id TEXT PRIMARY KEY NOT NULL,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
excerpt TEXT,
content TEXT,
cover_image_id TEXT,
author_id TEXT,
author_name TEXT,
status TEXT DEFAULT 'draft',
tags TEXT,
published_at INTEGER,
views INTEGER DEFAULT 0,
likes INTEGER DEFAULT 0,
saves INTEGER DEFAULT 0,
shares INTEGER DEFAULT 0,
meta_title TEXT,
meta_description TEXT,
canonical_url TEXT,
created_at INTEGER,
updated_at INTEGER
)
=== user ===
CREATE TABLE user (id TEXT PRIMARY KEY, email TEXT NOT NULL UNIQUE, emailVerified INTEGER DEFAULT 0, phone TEXT, name TEXT NOT NULL, image TEXT, role TEXT DEFAULT 'user', createdAt INTEGER DEFAULT (strftime('%s', 'now')), updatedAt INTEGER DEFAULT (strftime('%s', 'now')))
=== session ===
CREATE TABLE session (id TEXT PRIMARY KEY, userId TEXT NOT NULL, token TEXT NOT NULL UNIQUE, expiresAt INTEGER NOT NULL, userAgent TEXT, ipAddress TEXT, createdAt INTEGER DEFAULT (strftime('%s', 'now')), updatedAt INTEGER DEFAULT (strftime('%s', 'now')))
=== account ===
CREATE TABLE account (id TEXT PRIMARY KEY, userId TEXT NOT NULL, accountId TEXT NOT NULL, providerId TEXT NOT NULL, accessToken TEXT, refreshToken TEXT, idToken TEXT, accessTokenExpiresAt INTEGER, refreshTokenExpiresAt INTEGER, scope TEXT, password TEXT, createdAt INTEGER DEFAULT (strftime('%s', 'now')), updatedAt INTEGER DEFAULT (strftime('%s', 'now')))
=== verification ===
CREATE TABLE verification (id TEXT PRIMARY KEY, identifier TEXT NOT NULL, value TEXT NOT NULL, expiresAt INTEGER NOT NULL, createdAt INTEGER DEFAULT (strftime('%s', 'now')))
=== reviews ===
CREATE TABLE reviews (
id TEXT PRIMARY KEY NOT NULL,
business_id TEXT NOT NULL,
user_id TEXT NOT NULL,
rating INTEGER NOT NULL,
title TEXT,
content TEXT,
reply TEXT,
replied_at INTEGER,
replied_by TEXT,
status TEXT DEFAULT 'pending',
created_at INTEGER,
updated_at INTEGER
)
=== saved_items ===
CREATE TABLE saved_items (
id TEXT PRIMARY KEY NOT NULL,
user_id TEXT NOT NULL,
item_type TEXT NOT NULL,
item_id TEXT NOT NULL,
created_at INTEGER
)
=== business_categories ===
CREATE TABLE business_categories (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
icon TEXT,
parent_id TEXT,
sort_order INTEGER DEFAULT 0,
is_active INTEGER DEFAULT 1,
created_at INTEGER,
updated_at INTEGER
)
=== non_profit_categories ===
CREATE TABLE non_profit_categories (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
icon TEXT,
parent_id TEXT,
sort_order INTEGER DEFAULT 0,
is_active INTEGER DEFAULT 1,
created_at INTEGER,
updated_at INTEGER
)
=== public_sector_categories ===
CREATE TABLE public_sector_categories (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
icon TEXT,
parent_id TEXT,
sort_order INTEGER DEFAULT 0,
is_active INTEGER DEFAULT 1,
created_at INTEGER,
updated_at INTEGER
)
=== listing_categories ===
CREATE TABLE listing_categories (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
icon TEXT,
parent_id TEXT,
sort_order INTEGER DEFAULT 0,
is_active INTEGER DEFAULT 1,
created_at INTEGER,
updated_at INTEGER
, form_fields TEXT)
=== product_categories ===
CREATE TABLE product_categories (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
icon TEXT,
parent_id TEXT,
sort_order INTEGER DEFAULT 0,
is_active INTEGER DEFAULT 1,
form_fields TEXT,
created_at INTEGER,
updated_at INTEGER
)
=== blog_categories ===
CREATE TABLE blog_categories (
id TEXT PRIMARY KEY NOT NULL,
name TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
description TEXT,
icon TEXT,
parent_id TEXT,
sort_order INTEGER DEFAULT 0,
is_active INTEGER DEFAULT 1,
created_at INTEGER,
updated_at INTEGER
)
=== site_settings ===
CREATE TABLE site_settings (
id TEXT PRIMARY KEY NOT NULL,
key TEXT NOT NULL UNIQUE,
value TEXT,
type TEXT DEFAULT 'string',
description TEXT,
is_public INTEGER DEFAULT 0,
created_at INTEGER,
updated_at INTEGER
)
=== latest_updates ===
CREATE TABLE latest_updates (
id TEXT PRIMARY KEY NOT NULL,
type TEXT NOT NULL,
type_id TEXT NOT NULL,
content TEXT NOT NULL,
image_ids TEXT,
video_id TEXT,
created_at INTEGER,
updated_at INTEGER
)