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 "code": {
19 "name": "code",
20 "type": "text",
21 "unsigned": false,
22 "autoincrement": false,
23 "primary": false,
24 "nullable": true,
25 "mappedType": "text"
26 },
27 "currency_code": {
28 "name": "currency_code",
29 "type": "text",
30 "unsigned": false,
31 "autoincrement": false,
32 "primary": false,
33 "nullable": false,
34 "mappedType": "text"
35 },
36 "customer_id": {
37 "name": "customer_id",
38 "type": "text",
39 "unsigned": false,
40 "autoincrement": false,
41 "primary": false,
42 "nullable": true,
43 "mappedType": "text"
44 },
45 "metadata": {
46 "name": "metadata",
47 "type": "jsonb",
48 "unsigned": false,
49 "autoincrement": false,
50 "primary": false,
51 "nullable": true,
52 "mappedType": "json"
53 },
54 "created_at": {
55 "name": "created_at",
56 "type": "timestamptz",
57 "unsigned": false,
58 "autoincrement": false,
59 "primary": false,
60 "nullable": false,
61 "length": 6,
62 "default": "now()",
63 "mappedType": "datetime"
64 },
65 "updated_at": {
66 "name": "updated_at",
67 "type": "timestamptz",
68 "unsigned": false,
69 "autoincrement": false,
70 "primary": false,
71 "nullable": false,
72 "length": 6,
73 "default": "now()",
74 "mappedType": "datetime"
75 },
76 "deleted_at": {
77 "name": "deleted_at",
78 "type": "timestamptz",
79 "unsigned": false,
80 "autoincrement": false,
81 "primary": false,
82 "nullable": true,
83 "length": 6,
84 "mappedType": "datetime"
85 }
86 },
87 "name": "store_credit_account",
88 "schema": "public",
89 "indexes": [
90 {
91 "keyName": "IDX_store_credit_account_deleted_at",
92 "columnNames": [],
93 "composite": false,
94 "constraint": false,
95 "primary": false,
96 "unique": false,
97 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_store_credit_account_deleted_at\" ON \"store_credit_account\" (deleted_at) WHERE deleted_at IS NULL"
98 },
99 {
100 "keyName": "IDX_customer_id_currency_code",
101 "columnNames": [],
102 "composite": false,
103 "constraint": false,
104 "primary": false,
105 "unique": false,
106 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_customer_id_currency_code\" ON \"store_credit_account\" (customer_id, currency_code) WHERE customer_id IS NOT NULL AND deleted_at IS NULL"
107 },
108 {
109 "keyName": "store_credit_account_pkey",
110 "columnNames": [
111 "id"
112 ],
113 "composite": false,
114 "constraint": true,
115 "primary": true,
116 "unique": true
117 }
118 ],
119 "checks": [],
120 "foreignKeys": {},
121 "nativeEnums": {}
122 },
123 {
124 "columns": {
125 "id": {
126 "name": "id",
127 "type": "text",
128 "unsigned": false,
129 "autoincrement": false,
130 "primary": false,
131 "nullable": false,
132 "mappedType": "text"
133 },
134 "amount": {
135 "name": "amount",
136 "type": "numeric",
137 "unsigned": false,
138 "autoincrement": false,
139 "primary": false,
140 "nullable": false,
141 "mappedType": "decimal"
142 },
143 "type": {
144 "name": "type",
145 "type": "text",
146 "unsigned": false,
147 "autoincrement": false,
148 "primary": false,
149 "nullable": false,
150 "enumItems": [
151 "credit",
152 "debit"
153 ],
154 "mappedType": "enum"
155 },
156 "reference": {
157 "name": "reference",
158 "type": "text",
159 "unsigned": false,
160 "autoincrement": false,
161 "primary": false,
162 "nullable": false,
163 "mappedType": "text"
164 },
165 "reference_id": {
166 "name": "reference_id",
167 "type": "text",
168 "unsigned": false,
169 "autoincrement": false,
170 "primary": false,
171 "nullable": false,
172 "mappedType": "text"
173 },
174 "note": {
175 "name": "note",
176 "type": "text",
177 "unsigned": false,
178 "autoincrement": false,
179 "primary": false,
180 "nullable": true,
181 "mappedType": "text"
182 },
183 "account_id": {
184 "name": "account_id",
185 "type": "text",
186 "unsigned": false,
187 "autoincrement": false,
188 "primary": false,
189 "nullable": false,
190 "mappedType": "text"
191 },
192 "metadata": {
193 "name": "metadata",
194 "type": "jsonb",
195 "unsigned": false,
196 "autoincrement": false,
197 "primary": false,
198 "nullable": true,
199 "mappedType": "json"
200 },
201 "raw_amount": {
202 "name": "raw_amount",
203 "type": "jsonb",
204 "unsigned": false,
205 "autoincrement": false,
206 "primary": false,
207 "nullable": false,
208 "mappedType": "json"
209 },
210 "created_at": {
211 "name": "created_at",
212 "type": "timestamptz",
213 "unsigned": false,
214 "autoincrement": false,
215 "primary": false,
216 "nullable": false,
217 "length": 6,
218 "default": "now()",
219 "mappedType": "datetime"
220 },
221 "updated_at": {
222 "name": "updated_at",
223 "type": "timestamptz",
224 "unsigned": false,
225 "autoincrement": false,
226 "primary": false,
227 "nullable": false,
228 "length": 6,
229 "default": "now()",
230 "mappedType": "datetime"
231 },
232 "deleted_at": {
233 "name": "deleted_at",
234 "type": "timestamptz",
235 "unsigned": false,
236 "autoincrement": false,
237 "primary": false,
238 "nullable": true,
239 "length": 6,
240 "mappedType": "datetime"
241 }
242 },
243 "name": "store_credit_account_transaction",
244 "schema": "public",
245 "indexes": [
246 {
247 "keyName": "IDX_store_credit_account_transaction_account_id",
248 "columnNames": [],
249 "composite": false,
250 "constraint": false,
251 "primary": false,
252 "unique": false,
253 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_store_credit_account_transaction_account_id\" ON \"store_credit_account_transaction\" (account_id) WHERE deleted_at IS NULL"
254 },
255 {
256 "keyName": "IDX_store_credit_account_transaction_deleted_at",
257 "columnNames": [],
258 "composite": false,
259 "constraint": false,
260 "primary": false,
261 "unique": false,
262 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_store_credit_account_transaction_deleted_at\" ON \"store_credit_account_transaction\" (deleted_at) WHERE deleted_at IS NULL"
263 },
264 {
265 "keyName": "store_credit_account_transaction_pkey",
266 "columnNames": [
267 "id"
268 ],
269 "composite": false,
270 "constraint": true,
271 "primary": true,
272 "unique": true
273 }
274 ],
275 "checks": [],
276 "foreignKeys": {
277 "store_credit_account_transaction_account_id_foreign": {
278 "constraintName": "store_credit_account_transaction_account_id_foreign",
279 "columnNames": [
280 "account_id"
281 ],
282 "localTableName": "public.store_credit_account_transaction",
283 "referencedColumnNames": [
284 "id"
285 ],
286 "referencedTableName": "public.store_credit_account",
287 "updateRule": "cascade"
288 }
289 },
290 "nativeEnums": {}
291 }
292 ],
293 "nativeEnums": {}
294 }