1 {
2 "namespaces": [
3 "public"
4 ],
5 "name": "public",
6 "tables": [
7 {
8 "columns": {
9 "workflow_id": {
10 "name": "workflow_id",
11 "type": "text",
12 "unsigned": false,
13 "autoincrement": false,
14 "primary": false,
15 "nullable": false,
16 "mappedType": "text"
17 },
18 "transaction_id": {
19 "name": "transaction_id",
20 "type": "text",
21 "unsigned": false,
22 "autoincrement": false,
23 "primary": false,
24 "nullable": false,
25 "mappedType": "text"
26 },
27 "run_id": {
28 "name": "run_id",
29 "type": "text",
30 "unsigned": false,
31 "autoincrement": false,
32 "primary": false,
33 "nullable": false,
34 "mappedType": "text"
35 },
36 "id": {
37 "name": "id",
38 "type": "text",
39 "unsigned": false,
40 "autoincrement": false,
41 "primary": false,
42 "nullable": false,
43 "mappedType": "text"
44 },
45 "execution": {
46 "name": "execution",
47 "type": "jsonb",
48 "unsigned": false,
49 "autoincrement": false,
50 "primary": false,
51 "nullable": true,
52 "mappedType": "json"
53 },
54 "context": {
55 "name": "context",
56 "type": "jsonb",
57 "unsigned": false,
58 "autoincrement": false,
59 "primary": false,
60 "nullable": true,
61 "mappedType": "json"
62 },
63 "state": {
64 "name": "state",
65 "type": "text",
66 "unsigned": false,
67 "autoincrement": false,
68 "primary": false,
69 "nullable": false,
70 "enumItems": [
71 "not_started",
72 "invoking",
73 "waiting_to_compensate",
74 "compensating",
75 "done",
76 "reverted",
77 "failed"
78 ],
79 "mappedType": "enum"
80 },
81 "retention_time": {
82 "name": "retention_time",
83 "type": "integer",
84 "unsigned": false,
85 "autoincrement": false,
86 "primary": false,
87 "nullable": true,
88 "mappedType": "integer"
89 },
90 "created_at": {
91 "name": "created_at",
92 "type": "timestamptz",
93 "unsigned": false,
94 "autoincrement": false,
95 "primary": false,
96 "nullable": false,
97 "length": 6,
98 "default": "now()",
99 "mappedType": "datetime"
100 },
101 "updated_at": {
102 "name": "updated_at",
103 "type": "timestamptz",
104 "unsigned": false,
105 "autoincrement": false,
106 "primary": false,
107 "nullable": false,
108 "length": 6,
109 "default": "now()",
110 "mappedType": "datetime"
111 },
112 "deleted_at": {
113 "name": "deleted_at",
114 "type": "timestamptz",
115 "unsigned": false,
116 "autoincrement": false,
117 "primary": false,
118 "nullable": true,
119 "length": 6,
120 "mappedType": "datetime"
121 }
122 },
123 "name": "workflow_execution",
124 "schema": "public",
125 "indexes": [
126 {
127 "keyName": "IDX_workflow_execution_deleted_at",
128 "columnNames": [],
129 "composite": false,
130 "constraint": false,
131 "primary": false,
132 "unique": false,
133 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_deleted_at\" ON \"workflow_execution\" (deleted_at) WHERE deleted_at IS NULL"
134 },
135 {
136 "keyName": "IDX_workflow_execution_id",
137 "columnNames": [],
138 "composite": false,
139 "constraint": false,
140 "primary": false,
141 "unique": false,
142 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_id\" ON \"workflow_execution\" (id) WHERE deleted_at IS NULL"
143 },
144 {
145 "keyName": "IDX_workflow_execution_workflow_id",
146 "columnNames": [],
147 "composite": false,
148 "constraint": false,
149 "primary": false,
150 "unique": false,
151 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_workflow_id\" ON \"workflow_execution\" (workflow_id) WHERE deleted_at IS NULL"
152 },
153 {
154 "keyName": "IDX_workflow_execution_transaction_id",
155 "columnNames": [],
156 "composite": false,
157 "constraint": false,
158 "primary": false,
159 "unique": false,
160 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_transaction_id\" ON \"workflow_execution\" (transaction_id) WHERE deleted_at IS NULL"
161 },
162 {
163 "keyName": "IDX_workflow_execution_workflow_id_transaction_id_run_id_unique",
164 "columnNames": [],
165 "composite": false,
166 "constraint": false,
167 "primary": false,
168 "unique": false,
169 "expression": "CREATE UNIQUE INDEX IF NOT EXISTS \"IDX_workflow_execution_workflow_id_transaction_id_run_id_unique\" ON \"workflow_execution\" (workflow_id, transaction_id, run_id) WHERE deleted_at IS NULL"
170 },
171 {
172 "keyName": "IDX_workflow_execution_state",
173 "columnNames": [],
174 "composite": false,
175 "constraint": false,
176 "primary": false,
177 "unique": false,
178 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_state\" ON \"workflow_execution\" (state) WHERE deleted_at IS NULL"
179 },
180 {
181 "keyName": "IDX_workflow_execution_run_id",
182 "columnNames": [],
183 "composite": false,
184 "constraint": false,
185 "primary": false,
186 "unique": false,
187 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_run_id\" ON \"workflow_execution\" (run_id) WHERE deleted_at IS NULL"
188 },
189 {
190 "keyName": "IDX_workflow_execution_workflow_id_transaction_id",
191 "columnNames": [],
192 "composite": false,
193 "constraint": false,
194 "primary": false,
195 "unique": false,
196 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_workflow_id_transaction_id\" ON \"workflow_execution\" (workflow_id, transaction_id) WHERE deleted_at IS NULL"
197 },
198 {
199 "keyName": "IDX_workflow_execution_state_updated_at",
200 "columnNames": [],
201 "composite": false,
202 "constraint": false,
203 "primary": false,
204 "unique": false,
205 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_state_updated_at\" ON \"workflow_execution\" (state, updated_at) WHERE deleted_at IS NULL"
206 },
207 {
208 "keyName": "IDX_workflow_execution_retention_time_updated_at_state",
209 "columnNames": [],
210 "composite": false,
211 "constraint": false,
212 "primary": false,
213 "unique": false,
214 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_retention_time_updated_at_state\" ON \"workflow_execution\" (retention_time, updated_at, state) WHERE deleted_at IS NULL AND retention_time IS NOT NULL"
215 },
216 {
217 "keyName": "IDX_workflow_execution_updated_at_retention_time",
218 "columnNames": [],
219 "composite": false,
220 "constraint": false,
221 "primary": false,
222 "unique": false,
223 "expression": "CREATE INDEX IF NOT EXISTS \"IDX_workflow_execution_updated_at_retention_time\" ON \"workflow_execution\" (updated_at, retention_time) WHERE deleted_at IS NULL AND retention_time IS NOT NULL AND state IN ('done', 'failed', 'reverted')"
224 },
225 {
226 "keyName": "workflow_execution_pkey",
227 "columnNames": [
228 "workflow_id",
229 "transaction_id",
230 "run_id"
231 ],
232 "composite": true,
233 "constraint": true,
234 "primary": true,
235 "unique": true
236 }
237 ],
238 "checks": [],
239 "foreignKeys": {},
240 "nativeEnums": {}
241 }
242 ],
243 "nativeEnums": {}
244 }