-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase_dump.sql
More file actions
1686 lines (1218 loc) · 72.8 KB
/
database_dump.sql
File metadata and controls
1686 lines (1218 loc) · 72.8 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
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.17
-- Dumped by pg_dump version 14.5 (Homebrew)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA public;
--
-- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
--
-- Name: tsq_state; Type: TYPE; Schema: public; Owner: nwa
--
CREATE TYPE public.tsq_state AS (
search_query text,
parentheses_stack integer,
skip_for integer,
current_token text,
current_index integer,
current_char text,
previous_char text,
tokens text[]
);
ALTER TYPE public.tsq_state OWNER TO nwa;
--
-- Name: array_nremove(anyarray, anyelement, integer); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.array_nremove(anyarray, anyelement, integer) RETURNS anyarray
LANGUAGE sql IMMUTABLE
AS $_$
WITH replaced_positions AS (
SELECT UNNEST(
CASE
WHEN $2 IS NULL THEN
'{}'::int[]
WHEN $3 > 0 THEN
(array_positions($1, $2))[1:$3]
WHEN $3 < 0 THEN
(array_positions($1, $2))[
(cardinality(array_positions($1, $2)) + $3 + 1):
]
ELSE
'{}'::int[]
END
) AS position
)
SELECT COALESCE((
SELECT array_agg(value)
FROM unnest($1) WITH ORDINALITY AS t(value, index)
WHERE index NOT IN (SELECT position FROM replaced_positions)
), $1[1:0]);
$_$;
ALTER FUNCTION public.array_nremove(anyarray, anyelement, integer) OWNER TO nwa;
--
-- Name: fixed_inputs_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.fixed_inputs_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE subscriptions SET tsv = NULL WHERE product_id = NEW.product_id;
RETURN NEW;
END
$$;
ALTER FUNCTION public.fixed_inputs_trigger() OWNER TO nwa;
--
-- Name: generate_subscription_tsv(uuid); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.generate_subscription_tsv(sub_id uuid) RETURNS tsvector
LANGUAGE plpgsql
AS $$
DECLARE
gen_tsv TSVECTOR := NULL;
BEGIN
/*
To generate a `tsvector` we first need to construct a `text` 'document' with
meaningful data. That document is then fed into the `to_tsvector`
function. That 'document' in our case boils down to all relevant data of a
subscription. Because of our data model this requires a fair amount of
joins. To make the data gathering step somewhat easier to follow we've
split up the gathering of:
- resource type data
- subscription and product data
- fixed input data
- subscription customer description data
into three separate queries using a Common Table Expression (CTE or WITH
query). These three queries can be referenced to as tables, namely as
tables:
- rt_info
- sub_prod_info
- fi_info
- cust_info
The final query concatenates the corresponding rows of these three tables
into a single document to be fed to `to_tsvector`.
One thing of note is the usage of LEFT JOINs in the last query. This is
for subscriptions that have been just created. Eg those that are 'initial'
and as such might not yet have any resource types. A regular JOIN would
not produce a result in that case leaving use with no document to feed
into the `to_tsvector` function to populate the `tsv` column. Using a LEFT
JOIN, together with `coalesce` to turn NULL values into empty strings
(ensuring `concat_ws` does not return NULL), we will always get a
meaningful value.
*/
WITH rt_info AS (
SELECT s.subscription_id,
string_agg(rt.resource_type || ': ' || siv.value, ', ' ORDER BY rt.resource_type) AS rt_info
FROM subscription_instance_values siv
JOIN resource_types rt ON siv.resource_type_id = rt.resource_type_id
JOIN subscription_instances si ON siv.subscription_instance_id = si.subscription_instance_id
JOIN subscriptions s ON si.subscription_id = s.subscription_id
GROUP BY s.subscription_id),
sub_prod_info AS (
SELECT s.subscription_id,
array_to_string(
ARRAY ['subscription_id: ' || s.subscription_id,
'status: ' || s.status,
'insync: ' || s.insync,
'subscription_description: ' || s.description,
'note: ' || coalesce(s.note, ''),
'customer_id: ' || s.customer_id,
'product_id: ' || s.product_id],
', ') AS sub_info,
array_to_string(
ARRAY ['product_name: ' || p.name,
'product_description: ' || p.description,
'tag: ' || p.tag,
'product_type: ', p.product_type],
', ') AS prod_info
FROM subscriptions s
JOIN products p ON s.product_id = p.product_id),
fi_info AS (
SELECT s.subscription_id,
string_agg(fi.name || ': ' || fi.value, ', ' ORDER BY fi.name) AS fi_info
FROM subscriptions s
JOIN products p ON s.product_id = p.product_id
JOIN fixed_inputs fi ON p.product_id = fi.product_id
GROUP BY s.subscription_id),
cust_info AS (
SELECT s.subscription_id,
string_agg('customer_description: ' || scd.description, ', ') AS cust_info
FROM subscriptions s
JOIN subscription_customer_descriptions scd ON s.subscription_id = scd.subscription_id
GROUP BY s.subscription_id
)
SELECT to_tsvector('english',
concat_ws(', ',
coalesce(spi.sub_info, ''),
coalesce(spi.prod_info, ''),
coalesce(fi.fi_info, ''),
coalesce(rti.rt_info, ''),
coalesce(ci.cust_info, '')
))
INTO STRICT gen_tsv
FROM subscriptions s
LEFT JOIN sub_prod_info spi ON s.subscription_id = spi.subscription_id
LEFT JOIN fi_info fi ON s.subscription_id = fi.subscription_id
LEFT JOIN rt_info rti ON s.subscription_id = rti.subscription_id
LEFT JOIN cust_info ci ON s.subscription_id = ci.subscription_id
WHERE s.subscription_id = sub_id;
RETURN gen_tsv;
END
$$;
ALTER FUNCTION public.generate_subscription_tsv(sub_id uuid) OWNER TO nwa;
--
-- Name: parse_websearch(text); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.parse_websearch(search_query text) RETURNS tsquery
LANGUAGE sql IMMUTABLE
AS $$
SELECT parse_websearch('pg_catalog.simple', search_query);
$$;
ALTER FUNCTION public.parse_websearch(search_query text) OWNER TO nwa;
--
-- Name: parse_websearch(regconfig, text); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.parse_websearch(config regconfig, search_query text) RETURNS tsquery
LANGUAGE sql IMMUTABLE
AS $$
SELECT
string_agg(
(
CASE
WHEN position('''' IN words.word) > 0 THEN CONCAT(words.word, ':*')
ELSE words.word
END
),
' '
)::tsquery
FROM (
SELECT trim(
regexp_split_to_table(
websearch_to_tsquery(config, lower(search_query))::text,
' '
)
) AS word
) AS words
$$;
ALTER FUNCTION public.parse_websearch(config regconfig, search_query text) OWNER TO nwa;
--
-- Name: products_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.products_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE subscriptions SET tsv = NULL WHERE product_id = NEW.product_id;
RETURN NEW;
END
$$;
ALTER FUNCTION public.products_trigger() OWNER TO nwa;
--
-- Name: subscription_customer_descriptions_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.subscription_customer_descriptions_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE subscriptions SET tsv = NULL WHERE subscription_id = NEW.subscription_id;
RETURN NEW;
END
$$;
ALTER FUNCTION public.subscription_customer_descriptions_trigger() OWNER TO nwa;
--
-- Name: subscription_instance_values_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.subscription_instance_values_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
DECLARE
sub_id subscriptions.subscription_id%TYPE;
BEGIN
SELECT si.subscription_id
INTO STRICT sub_id
FROM subscription_instances si
WHERE si.subscription_instance_id = NEW.subscription_instance_id;
UPDATE subscriptions SET tsv = NULL WHERE subscription_id = sub_id;
RETURN NEW;
END
$$;
ALTER FUNCTION public.subscription_instance_values_trigger() OWNER TO nwa;
--
-- Name: subscriptions_ins_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.subscriptions_ins_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
/*
We have a separate insert trigger for subscriptions for the simple reason
that while we are processing the insert there is not yet a row, with the
just generated NEW.subscription_id, in the database to join with. Hence
this trigger will only use the values from the insert.
*/
SELECT to_tsvector('english',
concat_ws(', ',
array_to_string(
ARRAY ['subscription_id: ' || NEW.subscription_id,
'status: ' || NEW.status,
'insync: ' || NEW.insync,
'subscription_description: ' || NEW.description,
'note: ' || coalesce(NEW.note, ''),
'customer_id: ' || NEW.customer_id,
'product_id: ' || NEW.product_id],
', '),
array_to_string(
ARRAY ['product_name: ' || p.name,
'product_description: ' || p.description,
'tag: ' || p.tag,
'product_type: ', p.product_type],
', ')))
INTO STRICT NEW.tsv
FROM products p
WHERE p.product_id = NEW.product_id;
RETURN NEW;
END
$$;
ALTER FUNCTION public.subscriptions_ins_trigger() OWNER TO nwa;
--
-- Name: subscriptions_set_tsv_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.subscriptions_set_tsv_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE subscriptions
SET tsv = generate_subscription_tsv(NEW.subscription_id)
WHERE subscription_id = NEW.subscription_id;
RETURN NULL;
END
$$;
ALTER FUNCTION public.subscriptions_set_tsv_trigger() OWNER TO nwa;
--
-- Name: subscriptions_upd_trigger(); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.subscriptions_upd_trigger() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE subscriptions
SET tsv = NULL
WHERE subscription_id = NEW.subscription_id;
RETURN NULL;
END
$$;
ALTER FUNCTION public.subscriptions_upd_trigger() OWNER TO nwa;
--
-- Name: tsq_append_current_token(public.tsq_state); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_append_current_token(state public.tsq_state) RETURNS public.tsq_state
LANGUAGE plpgsql IMMUTABLE
AS $$
BEGIN
IF state.current_token != '' THEN
state.tokens := array_append(state.tokens, state.current_token);
state.current_token := '';
END IF;
RETURN state;
END;
$$;
ALTER FUNCTION public.tsq_append_current_token(state public.tsq_state) OWNER TO nwa;
--
-- Name: tsq_parse(text); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_parse(search_query text) RETURNS tsquery
LANGUAGE sql IMMUTABLE
AS $$
SELECT tsq_parse(get_current_ts_config(), search_query);
$$;
ALTER FUNCTION public.tsq_parse(search_query text) OWNER TO nwa;
--
-- Name: tsq_parse(regconfig, text); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_parse(config regconfig, search_query text) RETURNS tsquery
LANGUAGE sql IMMUTABLE
AS $$
SELECT tsq_process_tokens(config, tsq_tokenize(search_query));
$$;
ALTER FUNCTION public.tsq_parse(config regconfig, search_query text) OWNER TO nwa;
--
-- Name: tsq_parse(text, text); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_parse(config text, search_query text) RETURNS tsquery
LANGUAGE sql IMMUTABLE
AS $$
SELECT tsq_parse(config::regconfig, search_query);
$$;
ALTER FUNCTION public.tsq_parse(config text, search_query text) OWNER TO nwa;
--
-- Name: tsq_process_tokens(text[]); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_process_tokens(tokens text[]) RETURNS tsquery
LANGUAGE sql IMMUTABLE
AS $$
SELECT tsq_process_tokens(get_current_ts_config(), tokens);
$$;
ALTER FUNCTION public.tsq_process_tokens(tokens text[]) OWNER TO nwa;
--
-- Name: tsq_process_tokens(regconfig, text[]); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_process_tokens(config regconfig, tokens text[]) RETURNS tsquery
LANGUAGE plpgsql IMMUTABLE
AS $$
DECLARE
result_query text;
previous_value text;
value text;
BEGIN
result_query := '';
FOREACH value IN ARRAY tokens LOOP
IF value = '"' THEN
CONTINUE;
END IF;
IF value = 'or' THEN
value := ' | ';
END IF;
IF left(value, 1) = '"' AND right(value, 1) = '"' THEN
value := phraseto_tsquery(config, value);
ELSIF value NOT IN ('(', ' | ', ')', '-') THEN
value := quote_literal(value) || ':*';
END IF;
IF previous_value = '-' THEN
IF value = '(' THEN
value := '!' || value;
ELSIF value = ' | ' THEN
CONTINUE;
ELSE
value := '!(' || value || ')';
END IF;
END IF;
SELECT
CASE
WHEN result_query = '' THEN value
WHEN previous_value = ' | ' AND value = ' | ' THEN result_query
WHEN previous_value = ' | ' THEN result_query || ' | ' || value
WHEN previous_value IN ('!(', '(') OR value = ')' THEN result_query || value
WHEN value != ' | ' THEN result_query || ' & ' || value
ELSE result_query
END
INTO result_query;
previous_value := value;
END LOOP;
IF result_query = ' | ' THEN
RETURN to_tsquery('');
END IF;
RETURN to_tsquery(config, result_query);
END;
$$;
ALTER FUNCTION public.tsq_process_tokens(config regconfig, tokens text[]) OWNER TO nwa;
--
-- Name: tsq_tokenize(text); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_tokenize(search_query text) RETURNS text[]
LANGUAGE plpgsql IMMUTABLE
AS $$
DECLARE
state tsq_state;
BEGIN
SELECT
search_query::text AS search_query,
0::int AS parentheses_stack,
0 AS skip_for,
''::text AS current_token,
0 AS current_index,
''::text AS current_char,
''::text AS previous_char,
'{}'::text[] AS tokens
INTO state;
state.search_query := lower(trim(
regexp_replace(search_query, '""+', '""', 'g')
));
FOR state.current_index IN (
SELECT generate_series(1, length(state.search_query))
) LOOP
state.current_char := substring(
search_query FROM state.current_index FOR 1
);
IF state.skip_for > 0 THEN
state.skip_for := state.skip_for - 1;
CONTINUE;
END IF;
state := tsq_tokenize_character(state);
state.previous_char := state.current_char;
END LOOP;
state := tsq_append_current_token(state);
state.tokens := array_nremove(state.tokens, '(', -state.parentheses_stack);
RETURN state.tokens;
END;
$$;
ALTER FUNCTION public.tsq_tokenize(search_query text) OWNER TO nwa;
--
-- Name: tsq_tokenize_character(public.tsq_state); Type: FUNCTION; Schema: public; Owner: nwa
--
CREATE FUNCTION public.tsq_tokenize_character(state public.tsq_state) RETURNS public.tsq_state
LANGUAGE plpgsql IMMUTABLE
AS $$
BEGIN
IF state.current_char = '(' THEN
state.tokens := array_append(state.tokens, '(');
state.parentheses_stack := state.parentheses_stack + 1;
state := tsq_append_current_token(state);
ELSIF state.current_char = ')' THEN
IF (state.parentheses_stack > 0 AND state.current_token != '') THEN
state := tsq_append_current_token(state);
state.tokens := array_append(state.tokens, ')');
state.parentheses_stack := state.parentheses_stack - 1;
END IF;
ELSIF state.current_char = '"' THEN
state.skip_for := position('"' IN substring(
state.search_query FROM state.current_index + 1
));
IF state.skip_for > 1 THEN
state.tokens = array_append(
state.tokens,
substring(
state.search_query
FROM state.current_index FOR state.skip_for + 1
)
);
ELSIF state.skip_for = 0 THEN
state.current_token := state.current_token || state.current_char;
END IF;
ELSIF (
state.current_char = '-' AND
(state.current_index = 1 OR state.previous_char = ' ')
) THEN
state.tokens := array_append(state.tokens, '-');
ELSIF state.current_char = ' ' THEN
state := tsq_append_current_token(state);
ELSE
state.current_token = state.current_token || state.current_char;
END IF;
RETURN state;
END;
$$;
ALTER FUNCTION public.tsq_tokenize_character(state public.tsq_state) OWNER TO nwa;
SET default_tablespace = '';
--
-- Name: alembic_version; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.alembic_version (
version_num character varying(32) NOT NULL
);
ALTER TABLE public.alembic_version OWNER TO nwa;
--
-- Name: engine_settings; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.engine_settings (
global_lock boolean NOT NULL,
running_processes integer NOT NULL,
CONSTRAINT check_running_processes_positive CHECK ((running_processes >= 0))
);
ALTER TABLE public.engine_settings OWNER TO nwa;
--
-- Name: fixed_inputs; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.fixed_inputs (
fixed_input_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
name character varying NOT NULL,
value character varying NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
product_id uuid NOT NULL
);
ALTER TABLE public.fixed_inputs OWNER TO nwa;
--
-- Name: process_steps; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.process_steps (
stepid uuid DEFAULT public.uuid_generate_v4() NOT NULL,
pid uuid NOT NULL,
name character varying NOT NULL,
status character varying(50) NOT NULL,
state jsonb NOT NULL,
created_by character varying(255),
executed_at timestamp with time zone DEFAULT statement_timestamp() NOT NULL,
commit_hash character varying(40)
);
ALTER TABLE public.process_steps OWNER TO nwa;
--
-- Name: processes; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.processes (
pid uuid DEFAULT public.uuid_generate_v4() NOT NULL,
workflow character varying(255) NOT NULL,
assignee character varying(50) DEFAULT 'SYSTEM'::character varying NOT NULL,
last_status character varying(50) NOT NULL,
last_step character varying(255),
started_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
last_modified_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
failed_reason text,
traceback text,
created_by character varying(255),
is_task boolean DEFAULT false NOT NULL
);
ALTER TABLE public.processes OWNER TO nwa;
--
-- Name: processes_subscriptions; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.processes_subscriptions (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
pid uuid NOT NULL,
subscription_id uuid NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
workflow_target character varying(255) DEFAULT 'CREATE'::character varying NOT NULL
);
ALTER TABLE public.processes_subscriptions OWNER TO nwa;
--
-- Name: product_block_relations; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.product_block_relations (
in_use_by_id uuid NOT NULL,
depends_on_id uuid NOT NULL,
min integer,
max integer
);
ALTER TABLE public.product_block_relations OWNER TO nwa;
--
-- Name: product_block_resource_types; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.product_block_resource_types (
product_block_id uuid NOT NULL,
resource_type_id uuid NOT NULL
);
ALTER TABLE public.product_block_resource_types OWNER TO nwa;
--
-- Name: product_blocks; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.product_blocks (
product_block_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
name character varying NOT NULL,
description text NOT NULL,
tag character varying(20),
status character varying(255),
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
end_date timestamp with time zone
);
ALTER TABLE public.product_blocks OWNER TO nwa;
--
-- Name: product_product_blocks; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.product_product_blocks (
product_id uuid NOT NULL,
product_block_id uuid NOT NULL
);
ALTER TABLE public.product_product_blocks OWNER TO nwa;
--
-- Name: products; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.products (
product_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
name character varying NOT NULL,
description text NOT NULL,
product_type character varying(255) NOT NULL,
tag character varying(20) NOT NULL,
status character varying(255) NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
end_date timestamp with time zone
);
ALTER TABLE public.products OWNER TO nwa;
--
-- Name: products_workflows; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.products_workflows (
product_id uuid NOT NULL,
workflow_id uuid NOT NULL
);
ALTER TABLE public.products_workflows OWNER TO nwa;
--
-- Name: resource_types; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.resource_types (
resource_type_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
resource_type character varying(510) NOT NULL,
description text
);
ALTER TABLE public.resource_types OWNER TO nwa;
--
-- Name: subscription_customer_descriptions; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.subscription_customer_descriptions (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
subscription_id uuid NOT NULL,
customer_id uuid NOT NULL,
description text NOT NULL,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.subscription_customer_descriptions OWNER TO nwa;
--
-- Name: subscription_instance_relations; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.subscription_instance_relations (
in_use_by_id uuid NOT NULL,
depends_on_id uuid NOT NULL,
order_id integer NOT NULL,
domain_model_attr text
);
ALTER TABLE public.subscription_instance_relations OWNER TO nwa;
--
-- Name: subscription_instance_values; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.subscription_instance_values (
subscription_instance_value_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
subscription_instance_id uuid NOT NULL,
resource_type_id uuid NOT NULL,
value text NOT NULL
);
ALTER TABLE public.subscription_instance_values OWNER TO nwa;
--
-- Name: subscription_instances; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.subscription_instances (
subscription_instance_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
subscription_id uuid NOT NULL,
product_block_id uuid NOT NULL,
label character varying(255)
);
ALTER TABLE public.subscription_instances OWNER TO nwa;
--
-- Name: subscriptions; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.subscriptions (
subscription_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
description text NOT NULL,
status character varying(255) NOT NULL,
product_id uuid NOT NULL,
customer_id uuid NOT NULL,
insync boolean NOT NULL,
start_date timestamp with time zone,
end_date timestamp with time zone,
note text,
tsv tsvector
);
ALTER TABLE public.subscriptions OWNER TO nwa;
--
-- Name: workflows; Type: TABLE; Schema: public; Owner: nwa
--
CREATE TABLE public.workflows (
workflow_id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
name character varying NOT NULL,
target character varying NOT NULL,
description text,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE public.workflows OWNER TO nwa;
--
-- Data for Name: alembic_version; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.alembic_version (version_num) FROM stdin;
46287618baec
\.
--
-- Data for Name: engine_settings; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.engine_settings (global_lock, running_processes) FROM stdin;
f 0
\.
--
-- Data for Name: fixed_inputs; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.fixed_inputs (fixed_input_id, name, value, created_at, product_id) FROM stdin;
70cd63d7-3c76-46c6-bbdd-080067d77127 Affiliation internal 2022-10-11 15:28:38.104715+02 3431992f-1628-44a1-8ec5-1b2f86440987
239eb96a-abda-4ed2-a069-3fd5d5c5b86a Affiliation external 2022-10-11 15:28:38.104715+02 77fe1b9b-badf-4144-9261-b95683a54023
\.
--
-- Data for Name: process_steps; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.process_steps (stepid, pid, name, status, state, created_by, executed_at, commit_hash) FROM stdin;
90ce6800-a1ed-4a8c-a05b-e86c936747a8 969f694d-28ea-47ad-b002-1a26159e93a7 Start success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "workflow_name": "create_user_group", "workflow_target": "CREATE"} SYSTEM 2022-10-11 15:30:14.550022+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
0c047f88-4291-4ee5-af20-89ad2faf08a9 969f694d-28ea-47ad-b002-1a26159e93a7 Create subscription success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "werkt het?", "owner_subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "subscription_instance_id": "694a1c88-fe65-4a37-b034-235257533a51"}, "start_date": null, "customer_id": "0b4594d8-89ac-402b-ab5a-aa435b39abda", "description": "Initial subscription of User group product", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916"}, "workflow_name": "create_user_group", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:30:14.703159+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
5664925c-7dd0-4fb8-b454-a45207e6aceb 969f694d-28ea-47ad-b002-1a26159e93a7 Create Process Subscription relation success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "werkt het?", "owner_subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "subscription_instance_id": "694a1c88-fe65-4a37-b034-235257533a51"}, "start_date": null, "customer_id": "0b4594d8-89ac-402b-ab5a-aa435b39abda", "description": "Initial subscription of User group product", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916"}, "workflow_name": "create_user_group", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:30:14.729855+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
937ac007-7389-4746-8443-a365332d8138 969f694d-28ea-47ad-b002-1a26159e93a7 Set description success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "werkt het?", "owner_subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "subscription_instance_id": "694a1c88-fe65-4a37-b034-235257533a51"}, "start_date": null, "customer_id": "0b4594d8-89ac-402b-ab5a-aa435b39abda", "description": "Initial subscription of User group product", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916"}, "workflow_name": "create_user_group", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:30:14.83712+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
32ff1149-cfc3-4b64-8f56-03012f9ec63d 969f694d-28ea-47ad-b002-1a26159e93a7 Set subscription to 'active' success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "active", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "start_date": "2022-10-11T13:30:14+00:00", "customer_id": "0b4594d8-89ac-402b-ab5a-aa435b39abda", "description": "Initial subscription of User group product", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916"}, "workflow_name": "create_user_group", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:30:14.923306+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
55d053fd-e919-49ec-9c08-bf378c481e01 969f694d-28ea-47ad-b002-1a26159e93a7 Unlock subscription success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "subscription": {"note": null, "insync": true, "status": "active", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "start_date": "2022-10-11T13:30:14+00:00", "customer_id": "0b4594d8-89ac-402b-ab5a-aa435b39abda", "description": "Initial subscription of User group product", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916"}, "workflow_name": "create_user_group", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:30:14.993758+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
0c385c96-089e-4780-8208-34826cb00ffa 969f694d-28ea-47ad-b002-1a26159e93a7 Done complete {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "werkt het?", "process_id": "969f694d-28ea-47ad-b002-1a26159e93a7", "product_name": "User group", "subscription": {"note": null, "insync": true, "status": "active", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "start_date": "2022-10-11T13:30:14+00:00", "customer_id": "0b4594d8-89ac-402b-ab5a-aa435b39abda", "description": "Initial subscription of User group product", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916"}, "workflow_name": "create_user_group", "subscription_id": "5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:30:15.022616+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
36d0f8b0-5be5-4cb1-a37d-7852650cbc9d 17f0af51-216d-4a9b-b79e-4054f8ec815f Start success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "help", "process_id": "17f0af51-216d-4a9b-b79e-4054f8ec815f", "product_name": "User group", "workflow_name": "create_user_group", "workflow_target": "CREATE"} SYSTEM 2022-10-11 15:35:26.078774+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
845d729a-8331-4638-a763-c839af64a381 17f0af51-216d-4a9b-b79e-4054f8ec815f Create subscription success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "help", "process_id": "17f0af51-216d-4a9b-b79e-4054f8ec815f", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": null, "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "Initial subscription of User group product", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "workflow_name": "create_user_group", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:35:26.207903+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
32609abd-536a-4126-9676-7e9425e9f672 17f0af51-216d-4a9b-b79e-4054f8ec815f Set in sync and update lifecyle to provisioning success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "help", "process_id": "17f0af51-216d-4a9b-b79e-4054f8ec815f", "product_name": "User group", "subscription": {"note": null, "insync": true, "status": "active", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": "2022-10-11T13:35:26+00:00", "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "User group help", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "subsscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": null, "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "User group help", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "workflow_name": "create_user_group", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:35:26.521407+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
a4d658a1-3a10-4887-8024-25fe679e0f21 17f0af51-216d-4a9b-b79e-4054f8ec815f Create Process Subscription relation success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "help", "process_id": "17f0af51-216d-4a9b-b79e-4054f8ec815f", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": null, "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "Initial subscription of User group product", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "workflow_name": "create_user_group", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:35:26.233623+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
08127de3-c63f-481b-b212-636cf63b105f 17f0af51-216d-4a9b-b79e-4054f8ec815f Set description success {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "help", "process_id": "17f0af51-216d-4a9b-b79e-4054f8ec815f", "product_name": "User group", "subscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": null, "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "Initial subscription of User group product", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "subsscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": null, "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "User group help", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "workflow_name": "create_user_group", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:35:26.401175+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
203be397-4f88-4574-9221-9eff3e729d59 17f0af51-216d-4a9b-b79e-4054f8ec815f Done complete {"product": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "reporter": "SYSTEM", "group_name": "help", "process_id": "17f0af51-216d-4a9b-b79e-4054f8ec815f", "product_name": "User group", "subscription": {"note": null, "insync": true, "status": "active", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": "2022-10-11T13:35:26+00:00", "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "User group help", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "subsscription": {"note": null, "insync": false, "status": "initial", "product": {"tag": "GROUP", "name": "User group", "status": "active", "end_date": null, "created_at": "2022-10-11T13:28:38+00:00", "product_id": "800d1cf7-2039-4364-98b0-7cbbdd5fa44e", "description": "User group product", "product_type": "UserGroup"}, "end_date": null, "settings": {"name": "UserGroupBlock", "label": null, "group_name": "help", "owner_subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "subscription_instance_id": "9c4773bc-606a-4091-b8cf-09e33e3d2d53"}, "start_date": null, "customer_id": "d4b81a67-efe3-4378-b4ab-d87357f31d10", "description": "User group help", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7"}, "workflow_name": "create_user_group", "subscription_id": "9d6ddc7c-a918-439c-acc9-d273934e70e7", "workflow_target": "CREATE", "subscription_description": "Initial subscription of User group product"} SYSTEM 2022-10-11 15:35:26.53766+02 b10dc16f5814952e95f24e58cedbf3f589ca5fb4
\.
--
-- Data for Name: processes; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.processes (pid, workflow, assignee, last_status, last_step, started_at, last_modified_at, failed_reason, traceback, created_by, is_task) FROM stdin;
969f694d-28ea-47ad-b002-1a26159e93a7 create_user_group SYSTEM completed Done 2022-10-11 15:30:14.509662+02 2022-10-11 15:30:15.02492+02 \N \N SYSTEM f
17f0af51-216d-4a9b-b79e-4054f8ec815f create_user_group SYSTEM completed Done 2022-10-11 15:35:26.029966+02 2022-10-11 15:35:26.538608+02 \N \N SYSTEM f
\.
--
-- Data for Name: processes_subscriptions; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.processes_subscriptions (id, pid, subscription_id, created_at, workflow_target) FROM stdin;
bc757776-bcb1-46cf-bf8a-92055b27b6b8 969f694d-28ea-47ad-b002-1a26159e93a7 5b22fb23-80f5-4dbc-a5d3-5d55f3d0b916 2022-10-11 15:30:14.710501+02 CREATE
b2bc9760-2961-442c-93f0-e9c4d24441f9 17f0af51-216d-4a9b-b79e-4054f8ec815f 9d6ddc7c-a918-439c-acc9-d273934e70e7 2022-10-11 15:35:26.217936+02 CREATE
\.
--
-- Data for Name: product_block_relations; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.product_block_relations (in_use_by_id, depends_on_id, min, max) FROM stdin;
aee3e74b-4982-4e8e-b464-45103bc58954 b9a0accc-deec-462d-a843-184e9456bd0f \N \N
\.
--
-- Data for Name: product_block_resource_types; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.product_block_resource_types (product_block_id, resource_type_id) FROM stdin;
b9a0accc-deec-462d-a843-184e9456bd0f b8a10b35-e52d-4ac9-8266-f226bdf6ba30
aee3e74b-4982-4e8e-b464-45103bc58954 d7dab36f-0a16-4bc1-b793-e44e2b5debea
aee3e74b-4982-4e8e-b464-45103bc58954 49e3fb4f-664f-44f1-8cf9-76cf4ae9a0a4
aee3e74b-4982-4e8e-b464-45103bc58954 93ecaf19-4646-423e-873c-5d91889b974e
\.
--
-- Data for Name: product_blocks; Type: TABLE DATA; Schema: public; Owner: nwa
--
COPY public.product_blocks (product_block_id, name, description, tag, status, created_at, end_date) FROM stdin;
b9a0accc-deec-462d-a843-184e9456bd0f UserGroupBlock User group settings UGS active 2022-10-11 15:28:38.104715+02 \N
aee3e74b-4982-4e8e-b464-45103bc58954 UserBlock User settings US active 2022-10-11 15:28:38.104715+02 \N
\.