@processfocus/cli 0.1.0-next.0
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.md +28 -0
- package/README.md +736 -0
- package/dist/bundled-db-import.mjs +475 -0
- package/dist/bundled-graphql-schema.mjs +55 -0
- package/dist/main.mjs +1444 -0
- package/dist/prepare-deployment-artifact.mjs +4 -0
- package/dist/resources/cedar/policies.cedar +315 -0
- package/dist/resources/cedar/schema.cedarschema +276 -0
- package/dist/resources/system-migrations/20251230050207_wild_ikaris/migration.sql +1 -0
- package/dist/resources/system-migrations/20251230050207_wild_ikaris/snapshot.json +10 -0
- package/dist/resources/system-migrations/20260215222342_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260217210625_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260225225114_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260304233747_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260313015405_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260317191043_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260401023429_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260401074807_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260407221320_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260409221005_lyrical_slapstick/migration.sql +588 -0
- package/dist/resources/system-migrations/20260409221005_lyrical_slapstick/snapshot.json +5580 -0
- package/dist/resources/system-migrations/20260410054541_updated-at-triggers/migration.sql +259 -0
- package/dist/resources/system-migrations/20260410054541_updated-at-triggers/snapshot.json +5580 -0
- package/dist/resources/system-migrations/20260506185000_external-participants/migration.sql +27 -0
- package/dist/resources/system-migrations/20260525081848_confused_mac_gargan/migration.sql +16 -0
- package/dist/resources/system-migrations/20260525081848_confused_mac_gargan/snapshot.json +5929 -0
- package/dist/resources/system-migrations/20260525211724_ordinary_archangel/migration.sql +1 -0
- package/dist/resources/system-migrations/20260525211724_ordinary_archangel/snapshot.json +5954 -0
- package/dist/resources/system-migrations/20260526022120_cultured_daredevil/migration.sql +1 -0
- package/dist/resources/system-migrations/20260526022120_cultured_daredevil/snapshot.json +5979 -0
- package/dist/resources/system-migrations/20260607222956_blue_maelstrom/migration.sql +26 -0
- package/dist/resources/system-migrations/20260607222956_blue_maelstrom/snapshot.json +6139 -0
- package/dist/resources/system-migrations/20260608074412_productive_guardian/migration.sql +4 -0
- package/dist/resources/system-migrations/20260608074412_productive_guardian/snapshot.json +6179 -0
- package/dist/resources/system-migrations/20260609042621_huge_hellcat/migration.sql +3 -0
- package/dist/resources/system-migrations/20260609042621_huge_hellcat/snapshot.json +6209 -0
- package/dist/resources/system-migrations/20260626224225_glorious_tenebrous/migration.sql +107 -0
- package/dist/resources/system-migrations/20260626224225_glorious_tenebrous/snapshot.json +6221 -0
- package/dist/resources/system-migrations/20260722090215_mighty_colonel_america/migration.sql +26 -0
- package/dist/resources/system-migrations/20260722090215_mighty_colonel_america/snapshot.json +6490 -0
- package/dist/resources/system-migrations/20260722234847_brainy_quasimodo/migration.sql +1 -0
- package/dist/resources/system-migrations/20260722234847_brainy_quasimodo/snapshot.json +6500 -0
- package/dist/resources/system-migrations/20260727044204_nostalgic_lightspeed/migration.sql +51 -0
- package/dist/resources/system-migrations/20260727044204_nostalgic_lightspeed/snapshot.json +6670 -0
- package/dist/resources/system-migrations/20260727044743_green_thaddeus_ross/migration.sql +30 -0
- package/dist/resources/system-migrations/20260727044743_green_thaddeus_ross/snapshot.json +6670 -0
- package/dist/resources/system-migrations/20260727085203_safe_flatman/migration.sql +80 -0
- package/dist/resources/system-migrations/20260727085203_safe_flatman/snapshot.json +6803 -0
- package/dist/resources/system-migrations/20260727192244_natural_franklin_richards/migration.sql +14 -0
- package/dist/resources/system-migrations/20260727192244_natural_franklin_richards/snapshot.json +6947 -0
- package/dist/resources/system-migrations/20260727230751_updated-at-triggers/migration.sql +1 -0
- package/dist/resources/system-migrations/20260727230751_updated-at-triggers/snapshot.json +6947 -0
- package/dist/resources/system-migrations/20260727230758_pale_mother_askani/migration.sql +25 -0
- package/dist/resources/system-migrations/20260727230758_pale_mother_askani/snapshot.json +7121 -0
- package/dist/resources/system-migrations/20260831084613_nostalgic_hannibal_king/migration.sql +4 -0
- package/dist/resources/system-migrations/20260831084613_nostalgic_hannibal_king/snapshot.json +6852 -0
- package/dist/resources/system-migrations/20260906234923_stiff_maria_hill/migration.sql +77 -0
- package/dist/resources/system-migrations/20260906234923_stiff_maria_hill/snapshot.json +7396 -0
- package/dist/resources/system-migrations/20260907104651_delegation-rename-snapshots/migration.sql +2 -0
- package/dist/resources/system-migrations/20260907104651_delegation-rename-snapshots/snapshot.json +7416 -0
- package/dist/resources/system-migrations/20260907113440_abandoned_vertigo/migration.sql +2 -0
- package/dist/resources/system-migrations/20260907113440_abandoned_vertigo/snapshot.json +7466 -0
- package/dist/resources/system-migrations/20260908002610_mute_sharon_ventura/migration.sql +87 -0
- package/dist/resources/system-migrations/20260908002610_mute_sharon_ventura/snapshot.json +7491 -0
- package/dist/resources/system-migrations/20260914100808_slippery_ultragirl/migration.sql +1 -0
- package/dist/resources/system-migrations/20260914100808_slippery_ultragirl/snapshot.json +7501 -0
- package/dist/resources/system-migrations/20260919083020_passkey-name/migration.sql +1 -0
- package/dist/resources/system-migrations/20260919083020_passkey-name/snapshot.json +7511 -0
- package/dist/resources/system-migrations/20260919094049_passkey-last-used/migration.sql +1 -0
- package/dist/resources/system-migrations/20260919094049_passkey-last-used/snapshot.json +7521 -0
- package/package.json +36 -0
|
@@ -0,0 +1,588 @@
|
|
|
1
|
+
CREATE TABLE `pf_calendar_period` (
|
|
2
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
3
|
+
`org_unit_id` text(41) NOT NULL,
|
|
4
|
+
`period_kind` text(64) NOT NULL,
|
|
5
|
+
`period_title` text collate nocase NOT NULL,
|
|
6
|
+
`period_start` real NOT NULL,
|
|
7
|
+
`period_end` real NOT NULL,
|
|
8
|
+
`period_active` integer NOT NULL,
|
|
9
|
+
`period_schedule` text,
|
|
10
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
11
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
12
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
13
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
14
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
15
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
16
|
+
CONSTRAINT "period_title_length_check" CHECK(length("pf_calendar_period"."period_title") <= 256)
|
|
17
|
+
);
|
|
18
|
+
--> statement-breakpoint
|
|
19
|
+
CREATE INDEX `pf_calendar_period_kinddateidx_idx` ON `pf_calendar_period` (`period_kind`,`period_start`,`period_end`) WHERE _deleted = 0;--> statement-breakpoint
|
|
20
|
+
CREATE INDEX `pf_calendar_period_updated_at_id_idx` ON `pf_calendar_period` (`updated_at`,`id`);--> statement-breakpoint
|
|
21
|
+
CREATE TABLE `pf_completed_job` (
|
|
22
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
23
|
+
`queue` text(512) NOT NULL,
|
|
24
|
+
`job_id` text(1024) NOT NULL,
|
|
25
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
26
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
27
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
28
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
29
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
30
|
+
);
|
|
31
|
+
--> statement-breakpoint
|
|
32
|
+
CREATE UNIQUE INDEX `pf_completed_job_job_id_ix_idx` ON `pf_completed_job` (`queue`,`job_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
33
|
+
CREATE INDEX `pf_completed_job_updated_at_id_idx` ON `pf_completed_job` (`updated_at`,`id`);--> statement-breakpoint
|
|
34
|
+
CREATE TABLE `pf_date_exception` (
|
|
35
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
36
|
+
`org_unit_id` text(41) NOT NULL,
|
|
37
|
+
`exception_date` real NOT NULL,
|
|
38
|
+
`exception_slots` text NOT NULL,
|
|
39
|
+
`exception_note` text collate nocase,
|
|
40
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
41
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
42
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
43
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
44
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
45
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action
|
|
46
|
+
);
|
|
47
|
+
--> statement-breakpoint
|
|
48
|
+
CREATE UNIQUE INDEX `pf_date_exception_orgunitdateidx_idx` ON `pf_date_exception` (`org_unit_id`,`exception_date`) WHERE _deleted = 0;--> statement-breakpoint
|
|
49
|
+
CREATE INDEX `pf_date_exception_updated_at_id_idx` ON `pf_date_exception` (`updated_at`,`id`);--> statement-breakpoint
|
|
50
|
+
CREATE TABLE `pf_document_store` (
|
|
51
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
52
|
+
`org_unit_id` text(41) NOT NULL,
|
|
53
|
+
`name` text collate nocase NOT NULL,
|
|
54
|
+
`path` text(2048) NOT NULL,
|
|
55
|
+
`accepted_types` text,
|
|
56
|
+
`size_limit` integer,
|
|
57
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
58
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
59
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
60
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
61
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
62
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
63
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_document_store"."name") <= 1024)
|
|
64
|
+
);
|
|
65
|
+
--> statement-breakpoint
|
|
66
|
+
CREATE UNIQUE INDEX `pf_document_store_pathidx_idx` ON `pf_document_store` (`path`) WHERE _deleted = 0;--> statement-breakpoint
|
|
67
|
+
CREATE INDEX `pf_document_store_updated_at_id_idx` ON `pf_document_store` (`updated_at`,`id`);--> statement-breakpoint
|
|
68
|
+
CREATE TABLE `pf_file` (
|
|
69
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
70
|
+
`document_store_id` text(41) NOT NULL,
|
|
71
|
+
`file_size` integer,
|
|
72
|
+
`media_kind` text(256),
|
|
73
|
+
`upload_pending` integer DEFAULT true NOT NULL,
|
|
74
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
75
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
76
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
77
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
78
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
79
|
+
FOREIGN KEY (`document_store_id`) REFERENCES `pf_document_store`(`id`) ON UPDATE no action ON DELETE no action
|
|
80
|
+
);
|
|
81
|
+
--> statement-breakpoint
|
|
82
|
+
CREATE INDEX `pf_file_updated_at_id_idx` ON `pf_file` (`updated_at`,`id`);--> statement-breakpoint
|
|
83
|
+
CREATE TABLE `pf_flow` (
|
|
84
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
85
|
+
`flow_key` text(128) NOT NULL,
|
|
86
|
+
`source_step` text(41) NOT NULL,
|
|
87
|
+
`target_step` text(41) NOT NULL,
|
|
88
|
+
`condition` text collate nocase,
|
|
89
|
+
`schedule` text collate nocase,
|
|
90
|
+
`fallback_branch` integer DEFAULT false NOT NULL,
|
|
91
|
+
`error_branch` integer DEFAULT false NOT NULL,
|
|
92
|
+
`error_tags` text,
|
|
93
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
94
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
95
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
96
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
97
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
98
|
+
FOREIGN KEY (`source_step`) REFERENCES `pf_step`(`id`) ON UPDATE no action ON DELETE no action,
|
|
99
|
+
FOREIGN KEY (`target_step`) REFERENCES `pf_step`(`id`) ON UPDATE no action ON DELETE no action
|
|
100
|
+
);
|
|
101
|
+
--> statement-breakpoint
|
|
102
|
+
CREATE INDEX `pf_flow_sourcetargetidx_idx` ON `pf_flow` (`source_step`,`target_step`) WHERE _deleted = 0;--> statement-breakpoint
|
|
103
|
+
CREATE UNIQUE INDEX `pf_flow_flowkeyidx_idx` ON `pf_flow` (`flow_key`) WHERE _deleted = 0;--> statement-breakpoint
|
|
104
|
+
CREATE INDEX `pf_flow_updated_at_id_idx` ON `pf_flow` (`updated_at`,`id`);--> statement-breakpoint
|
|
105
|
+
CREATE TABLE `pf_holiday_instance` (
|
|
106
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
107
|
+
`org_unit_id` text(41) NOT NULL,
|
|
108
|
+
`holiday_title` text collate nocase NOT NULL,
|
|
109
|
+
`holiday_rule` text NOT NULL,
|
|
110
|
+
`holiday_date` real,
|
|
111
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
112
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
113
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
114
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
115
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
116
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
117
|
+
CONSTRAINT "holiday_title_length_check" CHECK(length("pf_holiday_instance"."holiday_title") <= 256)
|
|
118
|
+
);
|
|
119
|
+
--> statement-breakpoint
|
|
120
|
+
CREATE UNIQUE INDEX `pf_holiday_instance_orgunittitleidx_idx` ON `pf_holiday_instance` (`org_unit_id`,`holiday_title`) WHERE _deleted = 0;--> statement-breakpoint
|
|
121
|
+
CREATE INDEX `pf_holiday_instance_updated_at_id_idx` ON `pf_holiday_instance` (`updated_at`,`id`);--> statement-breakpoint
|
|
122
|
+
CREATE TABLE `pf_invitation` (
|
|
123
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
124
|
+
`invitation_id` text(128) NOT NULL,
|
|
125
|
+
`email` text(320) NOT NULL,
|
|
126
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
127
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
128
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
129
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
130
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
131
|
+
);
|
|
132
|
+
--> statement-breakpoint
|
|
133
|
+
CREATE UNIQUE INDEX `pf_invitation_invitationididx_idx` ON `pf_invitation` (`invitation_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
134
|
+
CREATE UNIQUE INDEX `pf_invitation_emailidx_idx` ON `pf_invitation` (`email`) WHERE _deleted = 0;--> statement-breakpoint
|
|
135
|
+
CREATE INDEX `pf_invitation_updated_at_id_idx` ON `pf_invitation` (`updated_at`,`id`);--> statement-breakpoint
|
|
136
|
+
CREATE TABLE `pf_invitation_role` (
|
|
137
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
138
|
+
`invitation_id` text(41) NOT NULL,
|
|
139
|
+
`role_id` text(41) NOT NULL,
|
|
140
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
141
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
142
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
143
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
144
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
145
|
+
FOREIGN KEY (`invitation_id`) REFERENCES `pf_invitation`(`id`) ON UPDATE no action ON DELETE no action,
|
|
146
|
+
FOREIGN KEY (`role_id`) REFERENCES `pf_role`(`id`) ON UPDATE no action ON DELETE no action
|
|
147
|
+
);
|
|
148
|
+
--> statement-breakpoint
|
|
149
|
+
CREATE UNIQUE INDEX `pf_invitation_role_invitationroleidx_idx` ON `pf_invitation_role` (`invitation_id`,`role_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
150
|
+
CREATE INDEX `pf_invitation_role_updated_at_id_idx` ON `pf_invitation_role` (`updated_at`,`id`);--> statement-breakpoint
|
|
151
|
+
CREATE TABLE `pf_job_queue` (
|
|
152
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
153
|
+
`queue` text(512) NOT NULL,
|
|
154
|
+
`job_payload` text NOT NULL,
|
|
155
|
+
`job_attempts` integer DEFAULT 0 NOT NULL,
|
|
156
|
+
`job_retry_limit` integer DEFAULT 5 NOT NULL,
|
|
157
|
+
`available_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
158
|
+
`locked_until` real,
|
|
159
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
160
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
161
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
162
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
163
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
164
|
+
);
|
|
165
|
+
--> statement-breakpoint
|
|
166
|
+
CREATE INDEX `pf_job_queue_ready_idx_idx` ON `pf_job_queue` (`queue`,`locked_until`,`job_attempts`,`available_at`) WHERE _deleted = 0;--> statement-breakpoint
|
|
167
|
+
CREATE INDEX `pf_job_queue_updated_at_id_idx` ON `pf_job_queue` (`updated_at`,`id`);--> statement-breakpoint
|
|
168
|
+
CREATE TABLE `pf_oauth_client` (
|
|
169
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
170
|
+
`client_id` text(128) NOT NULL,
|
|
171
|
+
`client_secret_hash` text(256) NOT NULL,
|
|
172
|
+
`audience` text(128) NOT NULL,
|
|
173
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
174
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
175
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
176
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
177
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
178
|
+
);
|
|
179
|
+
--> statement-breakpoint
|
|
180
|
+
CREATE UNIQUE INDEX `pf_oauth_client_clientididx_idx` ON `pf_oauth_client` (`client_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
181
|
+
CREATE INDEX `pf_oauth_client_updated_at_id_idx` ON `pf_oauth_client` (`updated_at`,`id`);--> statement-breakpoint
|
|
182
|
+
CREATE TABLE `pf_oauth_provider` (
|
|
183
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
184
|
+
`provider_name` text(64) NOT NULL,
|
|
185
|
+
`provider_config` text NOT NULL,
|
|
186
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
187
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
188
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
189
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
190
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
191
|
+
);
|
|
192
|
+
--> statement-breakpoint
|
|
193
|
+
CREATE UNIQUE INDEX `pf_oauth_provider_nameidx_idx` ON `pf_oauth_provider` (`provider_name`) WHERE _deleted = 0;--> statement-breakpoint
|
|
194
|
+
CREATE INDEX `pf_oauth_provider_updated_at_id_idx` ON `pf_oauth_provider` (`updated_at`,`id`);--> statement-breakpoint
|
|
195
|
+
CREATE TABLE `pf_oauth_storage` (
|
|
196
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
197
|
+
`oauth_key` text(2048) NOT NULL,
|
|
198
|
+
`key_kind` text(64) NOT NULL,
|
|
199
|
+
`key_value` text NOT NULL,
|
|
200
|
+
`key_expiry` real,
|
|
201
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
202
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
203
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
204
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
205
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
206
|
+
);
|
|
207
|
+
--> statement-breakpoint
|
|
208
|
+
CREATE UNIQUE INDEX `pf_oauth_storage_keyidx_idx` ON `pf_oauth_storage` (`oauth_key`);--> statement-breakpoint
|
|
209
|
+
CREATE INDEX `pf_oauth_storage_updated_at_id_idx` ON `pf_oauth_storage` (`updated_at`,`id`);--> statement-breakpoint
|
|
210
|
+
CREATE TABLE `pf_org_unit` (
|
|
211
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
212
|
+
`name` text collate nocase NOT NULL,
|
|
213
|
+
`org_unit_level` text(64) NOT NULL,
|
|
214
|
+
`parent_org_unit` text(41),
|
|
215
|
+
`path` text(2048) NOT NULL,
|
|
216
|
+
`acronym` text collate nocase,
|
|
217
|
+
`timezone` text(64) DEFAULT 'UTC' NOT NULL,
|
|
218
|
+
`start_day_of_week` integer DEFAULT 0,
|
|
219
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
220
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
221
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
222
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
223
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
224
|
+
FOREIGN KEY (`parent_org_unit`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
225
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_org_unit"."name") <= 1024),
|
|
226
|
+
CONSTRAINT "acronym_length_check" CHECK(length("pf_org_unit"."acronym") <= 64)
|
|
227
|
+
);
|
|
228
|
+
--> statement-breakpoint
|
|
229
|
+
CREATE UNIQUE INDEX `pf_org_unit_pathidx_idx` ON `pf_org_unit` (`path`) WHERE _deleted = 0;--> statement-breakpoint
|
|
230
|
+
CREATE INDEX `pf_org_unit_updated_at_id_idx` ON `pf_org_unit` (`updated_at`,`id`);--> statement-breakpoint
|
|
231
|
+
CREATE TABLE `pf_permitted_client_email` (
|
|
232
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
233
|
+
`oauth_client_id` text(41) NOT NULL,
|
|
234
|
+
`email` text(320) NOT NULL,
|
|
235
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
236
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
237
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
238
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
239
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
240
|
+
FOREIGN KEY (`oauth_client_id`) REFERENCES `pf_oauth_client`(`id`) ON UPDATE no action ON DELETE no action
|
|
241
|
+
);
|
|
242
|
+
--> statement-breakpoint
|
|
243
|
+
CREATE UNIQUE INDEX `pf_permitted_client_email_oauthclientemailidx_idx` ON `pf_permitted_client_email` (`oauth_client_id`,`email`) WHERE _deleted = 0;--> statement-breakpoint
|
|
244
|
+
CREATE INDEX `pf_permitted_client_email_updated_at_id_idx` ON `pf_permitted_client_email` (`updated_at`,`id`);--> statement-breakpoint
|
|
245
|
+
CREATE TABLE `pf_permitted_client_role` (
|
|
246
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
247
|
+
`oauth_client_id` text(41) NOT NULL,
|
|
248
|
+
`role_id` text(41) NOT NULL,
|
|
249
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
250
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
251
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
252
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
253
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
254
|
+
FOREIGN KEY (`oauth_client_id`) REFERENCES `pf_oauth_client`(`id`) ON UPDATE no action ON DELETE no action,
|
|
255
|
+
FOREIGN KEY (`role_id`) REFERENCES `pf_role`(`id`) ON UPDATE no action ON DELETE no action
|
|
256
|
+
);
|
|
257
|
+
--> statement-breakpoint
|
|
258
|
+
CREATE UNIQUE INDEX `pf_permitted_client_role_oauthclientroleidx_idx` ON `pf_permitted_client_role` (`oauth_client_id`,`role_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
259
|
+
CREATE INDEX `pf_permitted_client_role_updated_at_id_idx` ON `pf_permitted_client_role` (`updated_at`,`id`);--> statement-breakpoint
|
|
260
|
+
CREATE TABLE `pf_permitted_role` (
|
|
261
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
262
|
+
`provider_user_id` text(41) NOT NULL,
|
|
263
|
+
`role_id` text(41) NOT NULL,
|
|
264
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
265
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
266
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
267
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
268
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
269
|
+
FOREIGN KEY (`provider_user_id`) REFERENCES `pf_provider_user`(`id`) ON UPDATE no action ON DELETE no action,
|
|
270
|
+
FOREIGN KEY (`role_id`) REFERENCES `pf_role`(`id`) ON UPDATE no action ON DELETE no action
|
|
271
|
+
);
|
|
272
|
+
--> statement-breakpoint
|
|
273
|
+
CREATE UNIQUE INDEX `pf_permitted_role_provideruserroleidx_idx` ON `pf_permitted_role` (`provider_user_id`,`role_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
274
|
+
CREATE INDEX `pf_permitted_role_updated_at_id_idx` ON `pf_permitted_role` (`updated_at`,`id`);--> statement-breakpoint
|
|
275
|
+
CREATE TABLE `pf_phase` (
|
|
276
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
277
|
+
`process_id` text(41) NOT NULL,
|
|
278
|
+
`name` text collate nocase NOT NULL,
|
|
279
|
+
`path` text(2048) NOT NULL,
|
|
280
|
+
`phase_order` integer NOT NULL,
|
|
281
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
282
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
283
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
284
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
285
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
286
|
+
FOREIGN KEY (`process_id`) REFERENCES `pf_process`(`id`) ON UPDATE no action ON DELETE no action,
|
|
287
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_phase"."name") <= 1024)
|
|
288
|
+
);
|
|
289
|
+
--> statement-breakpoint
|
|
290
|
+
CREATE UNIQUE INDEX `pf_phase_pathidx_idx` ON `pf_phase` (`path`) WHERE _deleted = 0;--> statement-breakpoint
|
|
291
|
+
CREATE INDEX `pf_phase_updated_at_id_idx` ON `pf_phase` (`updated_at`,`id`);--> statement-breakpoint
|
|
292
|
+
CREATE TABLE `pf_process` (
|
|
293
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
294
|
+
`org_unit_id` text(41) NOT NULL,
|
|
295
|
+
`name` text collate nocase NOT NULL,
|
|
296
|
+
`path` text(2048) NOT NULL,
|
|
297
|
+
`purpose` text collate nocase NOT NULL,
|
|
298
|
+
`sla_value` integer,
|
|
299
|
+
`sla_unit` text(16),
|
|
300
|
+
`sla_warning` integer,
|
|
301
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
302
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
303
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
304
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
305
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
306
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
307
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_process"."name") <= 1024)
|
|
308
|
+
);
|
|
309
|
+
--> statement-breakpoint
|
|
310
|
+
CREATE UNIQUE INDEX `pf_process_pathidx_idx` ON `pf_process` (`path`) WHERE _deleted = 0;--> statement-breakpoint
|
|
311
|
+
CREATE INDEX `pf_process_updated_at_id_idx` ON `pf_process` (`updated_at`,`id`);--> statement-breakpoint
|
|
312
|
+
CREATE TABLE `pf_process_execution` (
|
|
313
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
314
|
+
`process_state_id` text(41) NOT NULL,
|
|
315
|
+
`finished_at` real,
|
|
316
|
+
`business_duration` integer,
|
|
317
|
+
`abandoned_at` real,
|
|
318
|
+
`abandoned_reason` text collate nocase,
|
|
319
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
320
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
321
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
322
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
323
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
324
|
+
FOREIGN KEY (`process_state_id`) REFERENCES `pf_process_state`(`id`) ON UPDATE no action ON DELETE no action
|
|
325
|
+
);
|
|
326
|
+
--> statement-breakpoint
|
|
327
|
+
CREATE INDEX `pf_process_execution_updated_at_id_idx` ON `pf_process_execution` (`updated_at`,`id`);--> statement-breakpoint
|
|
328
|
+
CREATE TABLE `pf_process_state` (
|
|
329
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
330
|
+
`process_id` text(41) NOT NULL,
|
|
331
|
+
`start_step` text(41) NOT NULL,
|
|
332
|
+
`state` text NOT NULL,
|
|
333
|
+
`started_by_user` text(41),
|
|
334
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
335
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
336
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
337
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
338
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
339
|
+
FOREIGN KEY (`process_id`) REFERENCES `pf_process`(`id`) ON UPDATE no action ON DELETE no action,
|
|
340
|
+
FOREIGN KEY (`start_step`) REFERENCES `pf_step`(`id`) ON UPDATE no action ON DELETE no action,
|
|
341
|
+
FOREIGN KEY (`started_by_user`) REFERENCES `pf_user`(`id`) ON UPDATE no action ON DELETE no action
|
|
342
|
+
);
|
|
343
|
+
--> statement-breakpoint
|
|
344
|
+
CREATE INDEX `pf_process_state_updated_at_id_idx` ON `pf_process_state` (`updated_at`,`id`);--> statement-breakpoint
|
|
345
|
+
CREATE TABLE `pf_provider_user` (
|
|
346
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
347
|
+
`user_id` text(41) NOT NULL,
|
|
348
|
+
`email` text(320) NOT NULL,
|
|
349
|
+
`name` text collate nocase NOT NULL,
|
|
350
|
+
`first_name` text collate nocase NOT NULL,
|
|
351
|
+
`last_name` text collate nocase NOT NULL,
|
|
352
|
+
`picture` text(1024) NOT NULL,
|
|
353
|
+
`locale` text(35) NOT NULL,
|
|
354
|
+
`org_unit_id` text(41) NOT NULL,
|
|
355
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
356
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
357
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
358
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
359
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
360
|
+
FOREIGN KEY (`user_id`) REFERENCES `pf_user`(`id`) ON UPDATE no action ON DELETE no action,
|
|
361
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
362
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_provider_user"."name") <= 1024),
|
|
363
|
+
CONSTRAINT "first_name_length_check" CHECK(length("pf_provider_user"."first_name") <= 128),
|
|
364
|
+
CONSTRAINT "last_name_length_check" CHECK(length("pf_provider_user"."last_name") <= 128)
|
|
365
|
+
);
|
|
366
|
+
--> statement-breakpoint
|
|
367
|
+
CREATE UNIQUE INDEX `pf_provider_user_emailidx_idx` ON `pf_provider_user` (`email`) WHERE _deleted = 0;--> statement-breakpoint
|
|
368
|
+
CREATE UNIQUE INDEX `pf_provider_user_user_unique_idx` ON `pf_provider_user` (`user_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
369
|
+
CREATE INDEX `pf_provider_user_updated_at_id_idx` ON `pf_provider_user` (`updated_at`,`id`);--> statement-breakpoint
|
|
370
|
+
CREATE TABLE `pf_provider_user_role` (
|
|
371
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
372
|
+
`provider_user_id` text(41) NOT NULL,
|
|
373
|
+
`role_id` text(41) NOT NULL,
|
|
374
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
375
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
376
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
377
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
378
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
379
|
+
FOREIGN KEY (`provider_user_id`) REFERENCES `pf_provider_user`(`id`) ON UPDATE no action ON DELETE no action,
|
|
380
|
+
FOREIGN KEY (`role_id`) REFERENCES `pf_role`(`id`) ON UPDATE no action ON DELETE no action
|
|
381
|
+
);
|
|
382
|
+
--> statement-breakpoint
|
|
383
|
+
CREATE UNIQUE INDEX `pf_provider_user_role_provideruserroleidx_idx` ON `pf_provider_user_role` (`provider_user_id`,`role_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
384
|
+
CREATE INDEX `pf_provider_user_role_updated_at_id_idx` ON `pf_provider_user_role` (`updated_at`,`id`);--> statement-breakpoint
|
|
385
|
+
CREATE TABLE `pf_role` (
|
|
386
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
387
|
+
`org_unit_id` text(41) NOT NULL,
|
|
388
|
+
`name` text collate nocase NOT NULL,
|
|
389
|
+
`path` text(2048) NOT NULL,
|
|
390
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
391
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
392
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
393
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
394
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
395
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action,
|
|
396
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_role"."name") <= 1024)
|
|
397
|
+
);
|
|
398
|
+
--> statement-breakpoint
|
|
399
|
+
CREATE UNIQUE INDEX `pf_role_pathidx_idx` ON `pf_role` (`path`) WHERE _deleted = 0;--> statement-breakpoint
|
|
400
|
+
CREATE UNIQUE INDEX `pf_role_orgunitunameidx_idx` ON `pf_role` (`org_unit_id`,`name`) WHERE _deleted = 0;--> statement-breakpoint
|
|
401
|
+
CREATE INDEX `pf_role_updated_at_id_idx` ON `pf_role` (`updated_at`,`id`);--> statement-breakpoint
|
|
402
|
+
CREATE TABLE `pf_role_responsibility` (
|
|
403
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
404
|
+
`process_id` text(41) NOT NULL,
|
|
405
|
+
`role_id` text(41) NOT NULL,
|
|
406
|
+
`responsibility` text collate nocase NOT NULL,
|
|
407
|
+
`responsibility_order` integer NOT NULL,
|
|
408
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
409
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
410
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
411
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
412
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
413
|
+
FOREIGN KEY (`process_id`) REFERENCES `pf_process`(`id`) ON UPDATE no action ON DELETE no action,
|
|
414
|
+
FOREIGN KEY (`role_id`) REFERENCES `pf_role`(`id`) ON UPDATE no action ON DELETE no action
|
|
415
|
+
);
|
|
416
|
+
--> statement-breakpoint
|
|
417
|
+
CREATE UNIQUE INDEX `pf_role_responsibility_processroleidx_idx` ON `pf_role_responsibility` (`process_id`,`role_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
418
|
+
CREATE INDEX `pf_role_responsibility_updated_at_id_idx` ON `pf_role_responsibility` (`updated_at`,`id`);--> statement-breakpoint
|
|
419
|
+
CREATE TABLE `pf_scheduled_flow` (
|
|
420
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
421
|
+
`process_execution_id` text(41) NOT NULL,
|
|
422
|
+
`source_step` text(41) NOT NULL,
|
|
423
|
+
`target_step` text(41),
|
|
424
|
+
`scheduled_at` real,
|
|
425
|
+
`for_each_barrier` integer DEFAULT false NOT NULL,
|
|
426
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
427
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
428
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
429
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
430
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
431
|
+
FOREIGN KEY (`process_execution_id`) REFERENCES `pf_process_execution`(`id`) ON UPDATE no action ON DELETE no action,
|
|
432
|
+
FOREIGN KEY (`source_step`) REFERENCES `pf_step`(`id`) ON UPDATE no action ON DELETE no action,
|
|
433
|
+
FOREIGN KEY (`target_step`) REFERENCES `pf_step`(`id`) ON UPDATE no action ON DELETE no action
|
|
434
|
+
);
|
|
435
|
+
--> statement-breakpoint
|
|
436
|
+
CREATE INDEX `pf_scheduled_flow_updated_at_id_idx` ON `pf_scheduled_flow` (`updated_at`,`id`);--> statement-breakpoint
|
|
437
|
+
CREATE TABLE `pf_step` (
|
|
438
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
439
|
+
`name` text collate nocase NOT NULL,
|
|
440
|
+
`path` text(2048) NOT NULL,
|
|
441
|
+
`purpose` text collate nocase NOT NULL,
|
|
442
|
+
`process_id` text(41) NOT NULL,
|
|
443
|
+
`role_id` text(41),
|
|
444
|
+
`form_fields` integer,
|
|
445
|
+
`phase_id` text(41),
|
|
446
|
+
`sla_value` integer,
|
|
447
|
+
`sla_unit` text(16),
|
|
448
|
+
`sla_warning` integer,
|
|
449
|
+
`has_for_each` integer DEFAULT false NOT NULL,
|
|
450
|
+
`embedded` integer DEFAULT false NOT NULL,
|
|
451
|
+
`retry_limit` integer,
|
|
452
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
453
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
454
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
455
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
456
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
457
|
+
FOREIGN KEY (`process_id`) REFERENCES `pf_process`(`id`) ON UPDATE no action ON DELETE no action,
|
|
458
|
+
FOREIGN KEY (`role_id`) REFERENCES `pf_role`(`id`) ON UPDATE no action ON DELETE no action,
|
|
459
|
+
FOREIGN KEY (`phase_id`) REFERENCES `pf_phase`(`id`) ON UPDATE no action ON DELETE no action,
|
|
460
|
+
CONSTRAINT "name_length_check" CHECK(length("pf_step"."name") <= 1024)
|
|
461
|
+
);
|
|
462
|
+
--> statement-breakpoint
|
|
463
|
+
CREATE UNIQUE INDEX `pf_step_pathidx_idx` ON `pf_step` (`path`) WHERE _deleted = 0;--> statement-breakpoint
|
|
464
|
+
CREATE INDEX `pf_step_updated_at_id_idx` ON `pf_step` (`updated_at`,`id`);--> statement-breakpoint
|
|
465
|
+
CREATE TABLE `pf_step_document_store` (
|
|
466
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
467
|
+
`step_id` text(41) NOT NULL,
|
|
468
|
+
`document_store_id` text(41) NOT NULL,
|
|
469
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
470
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
471
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
472
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
473
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
474
|
+
FOREIGN KEY (`step_id`) REFERENCES `pf_step`(`id`) ON UPDATE no action ON DELETE no action,
|
|
475
|
+
FOREIGN KEY (`document_store_id`) REFERENCES `pf_document_store`(`id`) ON UPDATE no action ON DELETE no action
|
|
476
|
+
);
|
|
477
|
+
--> statement-breakpoint
|
|
478
|
+
CREATE UNIQUE INDEX `pf_step_document_store_stepdocstoreidx_idx` ON `pf_step_document_store` (`step_id`,`document_store_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
479
|
+
CREATE INDEX `pf_step_document_store_updated_at_id_idx` ON `pf_step_document_store` (`updated_at`,`id`);--> statement-breakpoint
|
|
480
|
+
CREATE TABLE `pf_to_do` (
|
|
481
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
482
|
+
`process_execution_id` text(41) NOT NULL,
|
|
483
|
+
`flow_id` text(41) NOT NULL,
|
|
484
|
+
`completed_by_user` text(41),
|
|
485
|
+
`assigned_to_provider_user` text(41),
|
|
486
|
+
`business_duration` integer,
|
|
487
|
+
`sla_target_at` real,
|
|
488
|
+
`sla_warning_at` real,
|
|
489
|
+
`failure_reason` text collate nocase,
|
|
490
|
+
`item_data` text,
|
|
491
|
+
`barrier_scheduled_flow_id` text(41),
|
|
492
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
493
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
494
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
495
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
496
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
497
|
+
FOREIGN KEY (`process_execution_id`) REFERENCES `pf_process_execution`(`id`) ON UPDATE no action ON DELETE no action,
|
|
498
|
+
FOREIGN KEY (`flow_id`) REFERENCES `pf_flow`(`id`) ON UPDATE no action ON DELETE no action,
|
|
499
|
+
FOREIGN KEY (`completed_by_user`) REFERENCES `pf_user`(`id`) ON UPDATE no action ON DELETE no action,
|
|
500
|
+
FOREIGN KEY (`assigned_to_provider_user`) REFERENCES `pf_provider_user`(`id`) ON UPDATE no action ON DELETE no action
|
|
501
|
+
);
|
|
502
|
+
--> statement-breakpoint
|
|
503
|
+
CREATE INDEX `pf_to_do_updated_at_id_idx` ON `pf_to_do` (`updated_at`,`id`);--> statement-breakpoint
|
|
504
|
+
CREATE TABLE `pf_user` (
|
|
505
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
506
|
+
`provider` text(128) NOT NULL,
|
|
507
|
+
`sub` text(256) NOT NULL,
|
|
508
|
+
`last_logged_in` real NOT NULL,
|
|
509
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
510
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
511
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
512
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
513
|
+
`_deleted` integer DEFAULT false NOT NULL
|
|
514
|
+
);
|
|
515
|
+
--> statement-breakpoint
|
|
516
|
+
CREATE UNIQUE INDEX `pf_user_uniquesub_idx` ON `pf_user` (`provider`,`sub`) WHERE _deleted = 0;--> statement-breakpoint
|
|
517
|
+
CREATE INDEX `pf_user_updated_at_id_idx` ON `pf_user` (`updated_at`,`id`);--> statement-breakpoint
|
|
518
|
+
CREATE TABLE `pf_user_settings` (
|
|
519
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
520
|
+
`user_id` text(41) NOT NULL,
|
|
521
|
+
`notification_preference` text NOT NULL,
|
|
522
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
523
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
524
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
525
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
526
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
527
|
+
FOREIGN KEY (`user_id`) REFERENCES `pf_user`(`id`) ON UPDATE no action ON DELETE no action
|
|
528
|
+
);
|
|
529
|
+
--> statement-breakpoint
|
|
530
|
+
CREATE UNIQUE INDEX `pf_user_settings_user_unique_idx` ON `pf_user_settings` (`user_id`) WHERE _deleted = 0;--> statement-breakpoint
|
|
531
|
+
CREATE INDEX `pf_user_settings_updated_at_id_idx` ON `pf_user_settings` (`updated_at`,`id`);--> statement-breakpoint
|
|
532
|
+
CREATE TABLE `pf_weekly_schedule` (
|
|
533
|
+
`id` text(41) PRIMARY KEY NOT NULL,
|
|
534
|
+
`org_unit_id` text(41) NOT NULL,
|
|
535
|
+
`day_of_week` integer NOT NULL,
|
|
536
|
+
`time_ranges` text NOT NULL,
|
|
537
|
+
`created_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
538
|
+
`updated_at` real DEFAULT (julianday('now')) NOT NULL,
|
|
539
|
+
`created_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
540
|
+
`updated_by` text(256) DEFAULT 'SYSTEM' NOT NULL,
|
|
541
|
+
`_deleted` integer DEFAULT false NOT NULL,
|
|
542
|
+
FOREIGN KEY (`org_unit_id`) REFERENCES `pf_org_unit`(`id`) ON UPDATE no action ON DELETE no action
|
|
543
|
+
);
|
|
544
|
+
--> statement-breakpoint
|
|
545
|
+
CREATE UNIQUE INDEX `pf_weekly_schedule_orgunitdayidx_idx` ON `pf_weekly_schedule` (`org_unit_id`,`day_of_week`) WHERE _deleted = 0;--> statement-breakpoint
|
|
546
|
+
CREATE INDEX `pf_weekly_schedule_updated_at_id_idx` ON `pf_weekly_schedule` (`updated_at`,`id`);--> statement-breakpoint
|
|
547
|
+
CREATE VIEW `pf_process_its_active_processes` AS
|
|
548
|
+
select
|
|
549
|
+
pf_process.id,
|
|
550
|
+
count(distinct pf_to_do.id) as active_processes
|
|
551
|
+
from pf_process
|
|
552
|
+
left outer join pf_process_state on pf_process_state.process_id = pf_process.id and pf_process_state._deleted = false
|
|
553
|
+
left outer join pf_process_execution on pf_process_execution.process_state_id = pf_process_state.id and pf_process_execution._deleted = false
|
|
554
|
+
left outer join pf_to_do on pf_to_do.process_execution_id = pf_process_execution.id and pf_to_do._deleted = false
|
|
555
|
+
group by
|
|
556
|
+
pf_process.id
|
|
557
|
+
;--> statement-breakpoint
|
|
558
|
+
CREATE VIEW `pf_process_its_no_drafts` AS
|
|
559
|
+
select
|
|
560
|
+
id,
|
|
561
|
+
not exists (select 1 from pf_process_execution
|
|
562
|
+
join pf_process_state on pf_process_execution.process_state_id = pf_process_state.id and pf_process_state._deleted = false
|
|
563
|
+
where pf_process_state.process_id = pf_process.id and pf_process_execution._deleted = false) as no_drafts
|
|
564
|
+
from pf_process
|
|
565
|
+
;--> statement-breakpoint
|
|
566
|
+
CREATE VIEW `pf_process_its_start_step` AS
|
|
567
|
+
select
|
|
568
|
+
id,
|
|
569
|
+
(select pf_step.id from pf_step
|
|
570
|
+
join pf_step_its_can_start_process on pf_step.id = pf_step_its_can_start_process.id
|
|
571
|
+
where pf_step.process_id = pf_process.id
|
|
572
|
+
and pf_step_its_can_start_process.can_start_process = 1
|
|
573
|
+
and pf_step._deleted = false
|
|
574
|
+
limit 1) as start_step
|
|
575
|
+
from pf_process
|
|
576
|
+
;--> statement-breakpoint
|
|
577
|
+
CREATE VIEW `pf_process_state_its_is_draft` AS
|
|
578
|
+
select
|
|
579
|
+
id,
|
|
580
|
+
not exists (select 1 from pf_process_execution where pf_process_execution.process_state_id = pf_process_state.id and pf_process_execution._deleted = false) as is_draft
|
|
581
|
+
from pf_process_state
|
|
582
|
+
;--> statement-breakpoint
|
|
583
|
+
CREATE VIEW `pf_step_its_can_start_process` AS
|
|
584
|
+
select
|
|
585
|
+
id,
|
|
586
|
+
not exists (select 1 from pf_flow where pf_flow.target_step = pf_step.id and pf_flow._deleted = false) as can_start_process
|
|
587
|
+
from pf_step
|
|
588
|
+
;
|