1 {
2 "namespaces": [
3 "public"
4 ],
5 "name": "public",
6 "tables": [
7 {
8 "columns": {
9 "id": {
10 "name": "id",
11 "type": "text",
12 "unsigned": false,
13 "autoincrement": false,
14 "primary": false,
15 "nullable": false,
16 "mappedType": "text"
17 },
18 "company_name": {
19 "name": "company_name",
20 "type": "text",
21 "unsigned": false,
22 "autoincrement": false,
23 "primary": false,
24 "nullable": true,
25 "mappedType": "text"
26 },
27 "first_name": {
28 "name": "first_name",
29 "type": "text",
30 "unsigned": false,
31 "autoincrement": false,
32 "primary": false,
33 "nullable": true,
34 "mappedType": "text"
35 },
36 "last_name": {
37 "name": "last_name",
38 "type": "text",
39 "unsigned": false,
40 "autoincrement": false,
41 "primary": false,
42 "nullable": true,
43 "mappedType": "text"
44 },
45 "email": {
46 "name": "email",
47 "type": "text",
48 "unsigned": false,
49 "autoincrement": false,
50 "primary": false,
51 "nullable": true,
52 "mappedType": "text"
53 },
54 "phone": {
55 "name": "phone",
56 "type": "text",
57 "unsigned": false,
58 "autoincrement": false,
59 "primary": false,
60 "nullable": true,
61 "mappedType": "text"
62 },
63 "has_account": {
64 "name": "has_account",
65 "type": "boolean",
66 "unsigned": false,
67 "autoincrement": false,
68 "primary": false,
69 "nullable": false,
70 "default": "false",
71 "mappedType": "boolean"
72 },
73 "metadata": {
74 "name": "metadata",
75 "type": "jsonb",
76 "unsigned": false,
77 "autoincrement": false,
78 "primary": false,
79 "nullable": true,
80 "mappedType": "json"
81 },
82 "created_by": {
83 "name": "created_by",
84 "type": "text",
85 "unsigned": false,
86 "autoincrement": false,
87 "primary": false,
88 "nullable": true,
89 "mappedType": "text"
90 },
91 "created_at": {
92 "name": "created_at",
93 "type": "timestamptz",
94 "unsigned": false,
95 "autoincrement": false,
96 "primary": false,
97 "nullable": false,
98 "length": 6,
99 "default": "now()",
100 "mappedType": "datetime"
101 },
102 "updated_at": {
103 "name": "updated_at",
104 "type": "timestamptz",
105 "unsigned": false,
106 "autoincrement": false,
107 "primary": false,
108 "nullable": false,
109 "length": 6,
110 "default": "now()",
111 "mappedType": "datetime"
112 },
113 "deleted_at": {
114 "name": "deleted_at",
115 "type": "timestamptz",
116 "unsigned": false,
117 "autoincrement": false,
118 "primary": false,
119 "nullable": true,
120 "length": 6,
121 "mappedType": "datetime"
122 }
123 },
124 "name": "customer",
125 "schema": "public",
126 "indexes": [
127 {
128 "keyName": "IDX_customer_deleted_at",
129 "columnNames": [],
130 "composite": false,
131 "constraint": false,
132 "primary": false,
133 "unique": false,
134 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_deleted_at\" ON \"customer\" (deleted_at) WHERE deleted_at IS NULL"
135 },
136 {
137 "keyName": "IDX_customer_email_has_account_unique",
138 "columnNames": [],
139 "composite": false,
140 "constraint": false,
141 "primary": false,
142 "unique": false,
143 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_customer_email_has_account_unique\" ON \"customer\" (email, has_account) WHERE deleted_at IS NULL"
144 },
145 {
146 "keyName": "customer_pkey",
147 "columnNames": [
148 "id"
149 ],
150 "composite": false,
151 "constraint": true,
152 "primary": true,
153 "unique": true
154 }
155 ],
156 "checks": [],
157 "foreignKeys": {},
158 "nativeEnums": {}
159 },
160 {
161 "columns": {
162 "id": {
163 "name": "id",
164 "type": "text",
165 "unsigned": false,
166 "autoincrement": false,
167 "primary": false,
168 "nullable": false,
169 "mappedType": "text"
170 },
171 "address_name": {
172 "name": "address_name",
173 "type": "text",
174 "unsigned": false,
175 "autoincrement": false,
176 "primary": false,
177 "nullable": true,
178 "mappedType": "text"
179 },
180 "is_default_shipping": {
181 "name": "is_default_shipping",
182 "type": "boolean",
183 "unsigned": false,
184 "autoincrement": false,
185 "primary": false,
186 "nullable": false,
187 "default": "false",
188 "mappedType": "boolean"
189 },
190 "is_default_billing": {
191 "name": "is_default_billing",
192 "type": "boolean",
193 "unsigned": false,
194 "autoincrement": false,
195 "primary": false,
196 "nullable": false,
197 "default": "false",
198 "mappedType": "boolean"
199 },
200 "company": {
201 "name": "company",
202 "type": "text",
203 "unsigned": false,
204 "autoincrement": false,
205 "primary": false,
206 "nullable": true,
207 "mappedType": "text"
208 },
209 "first_name": {
210 "name": "first_name",
211 "type": "text",
212 "unsigned": false,
213 "autoincrement": false,
214 "primary": false,
215 "nullable": true,
216 "mappedType": "text"
217 },
218 "last_name": {
219 "name": "last_name",
220 "type": "text",
221 "unsigned": false,
222 "autoincrement": false,
223 "primary": false,
224 "nullable": true,
225 "mappedType": "text"
226 },
227 "address_1": {
228 "name": "address_1",
229 "type": "text",
230 "unsigned": false,
231 "autoincrement": false,
232 "primary": false,
233 "nullable": true,
234 "mappedType": "text"
235 },
236 "address_2": {
237 "name": "address_2",
238 "type": "text",
239 "unsigned": false,
240 "autoincrement": false,
241 "primary": false,
242 "nullable": true,
243 "mappedType": "text"
244 },
245 "city": {
246 "name": "city",
247 "type": "text",
248 "unsigned": false,
249 "autoincrement": false,
250 "primary": false,
251 "nullable": true,
252 "mappedType": "text"
253 },
254 "country_code": {
255 "name": "country_code",
256 "type": "text",
257 "unsigned": false,
258 "autoincrement": false,
259 "primary": false,
260 "nullable": true,
261 "mappedType": "text"
262 },
263 "province": {
264 "name": "province",
265 "type": "text",
266 "unsigned": false,
267 "autoincrement": false,
268 "primary": false,
269 "nullable": true,
270 "mappedType": "text"
271 },
272 "postal_code": {
273 "name": "postal_code",
274 "type": "text",
275 "unsigned": false,
276 "autoincrement": false,
277 "primary": false,
278 "nullable": true,
279 "mappedType": "text"
280 },
281 "phone": {
282 "name": "phone",
283 "type": "text",
284 "unsigned": false,
285 "autoincrement": false,
286 "primary": false,
287 "nullable": true,
288 "mappedType": "text"
289 },
290 "metadata": {
291 "name": "metadata",
292 "type": "jsonb",
293 "unsigned": false,
294 "autoincrement": false,
295 "primary": false,
296 "nullable": true,
297 "mappedType": "json"
298 },
299 "customer_id": {
300 "name": "customer_id",
301 "type": "text",
302 "unsigned": false,
303 "autoincrement": false,
304 "primary": false,
305 "nullable": false,
306 "mappedType": "text"
307 },
308 "created_at": {
309 "name": "created_at",
310 "type": "timestamptz",
311 "unsigned": false,
312 "autoincrement": false,
313 "primary": false,
314 "nullable": false,
315 "length": 6,
316 "default": "now()",
317 "mappedType": "datetime"
318 },
319 "updated_at": {
320 "name": "updated_at",
321 "type": "timestamptz",
322 "unsigned": false,
323 "autoincrement": false,
324 "primary": false,
325 "nullable": false,
326 "length": 6,
327 "default": "now()",
328 "mappedType": "datetime"
329 },
330 "deleted_at": {
331 "name": "deleted_at",
332 "type": "timestamptz",
333 "unsigned": false,
334 "autoincrement": false,
335 "primary": false,
336 "nullable": true,
337 "length": 6,
338 "mappedType": "datetime"
339 }
340 },
341 "name": "customer_address",
342 "schema": "public",
343 "indexes": [
344 {
345 "keyName": "IDX_customer_address_customer_id",
346 "columnNames": [],
347 "composite": false,
348 "constraint": false,
349 "primary": false,
350 "unique": false,
351 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_address_customer_id\" ON \"customer_address\" (customer_id) WHERE deleted_at IS NULL"
352 },
353 {
354 "keyName": "IDX_customer_address_deleted_at",
355 "columnNames": [],
356 "composite": false,
357 "constraint": false,
358 "primary": false,
359 "unique": false,
360 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_address_deleted_at\" ON \"customer_address\" (deleted_at) WHERE deleted_at IS NULL"
361 },
362 {
363 "keyName": "IDX_customer_address_unique_customer_billing",
364 "columnNames": [],
365 "composite": false,
366 "constraint": false,
367 "primary": false,
368 "unique": false,
369 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_customer_address_unique_customer_billing\" ON \"customer_address\" (customer_id) WHERE \"is_default_billing\" = true AND deleted_at IS NULL"
370 },
371 {
372 "keyName": "IDX_customer_address_unique_customer_shipping",
373 "columnNames": [],
374 "composite": false,
375 "constraint": false,
376 "primary": false,
377 "unique": false,
378 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_customer_address_unique_customer_shipping\" ON \"customer_address\" (customer_id) WHERE \"is_default_shipping\" = true AND deleted_at IS NULL"
379 },
380 {
381 "keyName": "customer_address_pkey",
382 "columnNames": [
383 "id"
384 ],
385 "composite": false,
386 "constraint": true,
387 "primary": true,
388 "unique": true
389 }
390 ],
391 "checks": [],
392 "foreignKeys": {
393 "customer_address_customer_id_foreign": {
394 "constraintName": "customer_address_customer_id_foreign",
395 "columnNames": [
396 "customer_id"
397 ],
398 "localTableName": "public.customer_address",
399 "referencedColumnNames": [
400 "id"
401 ],
402 "referencedTableName": "public.customer",
403 "deleteRule": "cascade",
404 "updateRule": "cascade"
405 }
406 },
407 "nativeEnums": {}
408 },
409 {
410 "columns": {
411 "id": {
412 "name": "id",
413 "type": "text",
414 "unsigned": false,
415 "autoincrement": false,
416 "primary": false,
417 "nullable": false,
418 "mappedType": "text"
419 },
420 "name": {
421 "name": "name",
422 "type": "text",
423 "unsigned": false,
424 "autoincrement": false,
425 "primary": false,
426 "nullable": false,
427 "mappedType": "text"
428 },
429 "metadata": {
430 "name": "metadata",
431 "type": "jsonb",
432 "unsigned": false,
433 "autoincrement": false,
434 "primary": false,
435 "nullable": true,
436 "mappedType": "json"
437 },
438 "created_by": {
439 "name": "created_by",
440 "type": "text",
441 "unsigned": false,
442 "autoincrement": false,
443 "primary": false,
444 "nullable": true,
445 "mappedType": "text"
446 },
447 "created_at": {
448 "name": "created_at",
449 "type": "timestamptz",
450 "unsigned": false,
451 "autoincrement": false,
452 "primary": false,
453 "nullable": false,
454 "length": 6,
455 "default": "now()",
456 "mappedType": "datetime"
457 },
458 "updated_at": {
459 "name": "updated_at",
460 "type": "timestamptz",
461 "unsigned": false,
462 "autoincrement": false,
463 "primary": false,
464 "nullable": false,
465 "length": 6,
466 "default": "now()",
467 "mappedType": "datetime"
468 },
469 "deleted_at": {
470 "name": "deleted_at",
471 "type": "timestamptz",
472 "unsigned": false,
473 "autoincrement": false,
474 "primary": false,
475 "nullable": true,
476 "length": 6,
477 "mappedType": "datetime"
478 }
479 },
480 "name": "customer_group",
481 "schema": "public",
482 "indexes": [
483 {
484 "keyName": "IDX_customer_group_deleted_at",
485 "columnNames": [],
486 "composite": false,
487 "constraint": false,
488 "primary": false,
489 "unique": false,
490 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_group_deleted_at\" ON \"customer_group\" (deleted_at) WHERE deleted_at IS NULL"
491 },
492 {
493 "keyName": "IDX_customer_group_name_unique",
494 "columnNames": [],
495 "composite": false,
496 "constraint": false,
497 "primary": false,
498 "unique": false,
499 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_customer_group_name_unique\" ON \"customer_group\" (name) WHERE deleted_at IS NULL"
500 },
501 {
502 "keyName": "customer_group_pkey",
503 "columnNames": [
504 "id"
505 ],
506 "composite": false,
507 "constraint": true,
508 "primary": true,
509 "unique": true
510 }
511 ],
512 "checks": [],
513 "foreignKeys": {},
514 "nativeEnums": {}
515 },
516 {
517 "columns": {
518 "id": {
519 "name": "id",
520 "type": "text",
521 "unsigned": false,
522 "autoincrement": false,
523 "primary": false,
524 "nullable": false,
525 "mappedType": "text"
526 },
527 "created_by": {
528 "name": "created_by",
529 "type": "text",
530 "unsigned": false,
531 "autoincrement": false,
532 "primary": false,
533 "nullable": true,
534 "mappedType": "text"
535 },
536 "metadata": {
537 "name": "metadata",
538 "type": "jsonb",
539 "unsigned": false,
540 "autoincrement": false,
541 "primary": false,
542 "nullable": true,
543 "mappedType": "json"
544 },
545 "customer_id": {
546 "name": "customer_id",
547 "type": "text",
548 "unsigned": false,
549 "autoincrement": false,
550 "primary": false,
551 "nullable": false,
552 "mappedType": "text"
553 },
554 "customer_group_id": {
555 "name": "customer_group_id",
556 "type": "text",
557 "unsigned": false,
558 "autoincrement": false,
559 "primary": false,
560 "nullable": false,
561 "mappedType": "text"
562 },
563 "created_at": {
564 "name": "created_at",
565 "type": "timestamptz",
566 "unsigned": false,
567 "autoincrement": false,
568 "primary": false,
569 "nullable": false,
570 "length": 6,
571 "default": "now()",
572 "mappedType": "datetime"
573 },
574 "updated_at": {
575 "name": "updated_at",
576 "type": "timestamptz",
577 "unsigned": false,
578 "autoincrement": false,
579 "primary": false,
580 "nullable": false,
581 "length": 6,
582 "default": "now()",
583 "mappedType": "datetime"
584 },
585 "deleted_at": {
586 "name": "deleted_at",
587 "type": "timestamptz",
588 "unsigned": false,
589 "autoincrement": false,
590 "primary": false,
591 "nullable": true,
592 "length": 6,
593 "mappedType": "datetime"
594 }
595 },
596 "name": "customer_group_customer",
597 "schema": "public",
598 "indexes": [
599 {
600 "keyName": "IDX_customer_group_customer_customer_id",
601 "columnNames": [],
602 "composite": false,
603 "constraint": false,
604 "primary": false,
605 "unique": false,
606 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_group_customer_customer_id\" ON \"customer_group_customer\" (customer_id) WHERE deleted_at IS NULL"
607 },
608 {
609 "keyName": "IDX_customer_group_customer_customer_group_id",
610 "columnNames": [],
611 "composite": false,
612 "constraint": false,
613 "primary": false,
614 "unique": false,
615 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_group_customer_customer_group_id\" ON \"customer_group_customer\" (customer_group_id) WHERE deleted_at IS NULL"
616 },
617 {
618 "keyName": "IDX_customer_group_customer_deleted_at",
619 "columnNames": [],
620 "composite": false,
621 "constraint": false,
622 "primary": false,
623 "unique": false,
624 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_customer_group_customer_deleted_at\" ON \"customer_group_customer\" (deleted_at) WHERE deleted_at IS NULL"
625 },
626 {
627 "keyName": "customer_group_customer_pkey",
628 "columnNames": [
629 "id"
630 ],
631 "composite": false,
632 "constraint": true,
633 "primary": true,
634 "unique": true
635 }
636 ],
637 "checks": [],
638 "foreignKeys": {},
639 "nativeEnums": {}
640 }
641 ],
642 "nativeEnums": {}
643 }