Skip to content

Commit 00382ff

Browse files
authored
adding migration (#6575)
1 parent 31b1e79 commit 00382ff

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
BEGIN;
2+
-- Drop Table: chart_category
3+
DROP TABLE IF EXISTS "public"."chart_category_mapping";
4+
5+
-- Drop Sequence: id_seq_chart_category
6+
DROP SEQUENCE IF EXISTS id_seq_chart_category_mapping;
7+
8+
9+
-- Drop Table: chart_category
10+
DROP TABLE IF EXISTS "public"."chart_category";
11+
12+
-- Drop Sequence: id_seq_chart_category
13+
DROP SEQUENCE IF EXISTS id_seq_chart_category;
14+
15+
16+
DROP TABLE IF EXISTS "public"."infrastructure_installation";
17+
18+
DROP SEQUENCE IF EXISTS id_seq_infrastructure_installation;
19+
20+
DROP TABLE IF EXISTS "public"."infrastructure_installation_versions";
21+
22+
DROP SEQUENCE IF EXISTS id_seq_infrastructure_installation_versions;
23+
24+
COMMIT;
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
BEGIN;
2+
-- Sequence
3+
CREATE SEQUENCE IF NOT EXISTS id_seq_chart_category;
4+
5+
-- DROP TABLE IF EXISTS public.chart_category;
6+
7+
CREATE TABLE IF NOT EXISTS public.chart_category
8+
(
9+
id integer NOT NULL DEFAULT nextval('id_seq_chart_category'::regclass),
10+
name character varying(250) COLLATE pg_catalog."default" NOT NULL,
11+
description text COLLATE pg_catalog."default" NOT NULL,
12+
deleted boolean NOT NULL,
13+
created_on timestamp with time zone,
14+
created_by integer,
15+
updated_on timestamp with time zone,
16+
updated_by integer,
17+
CONSTRAINT chart_category_pkey PRIMARY KEY (id)
18+
);
19+
20+
21+
-- Sequence
22+
CREATE SEQUENCE IF NOT EXISTS id_seq_chart_category_mapping;
23+
24+
25+
-- DROP TABLE IF EXISTS public.chart_category_mapping;
26+
27+
CREATE TABLE IF NOT EXISTS public.chart_category_mapping
28+
(
29+
id integer NOT NULL DEFAULT nextval('id_seq_chart_category_mapping'::regclass),
30+
app_store_id integer,
31+
chart_category_id integer,
32+
deleted boolean NOT NULL,
33+
created_on timestamp with time zone,
34+
created_by integer,
35+
updated_on timestamp with time zone,
36+
updated_by integer,
37+
CONSTRAINT chart_category_mapping_pkey PRIMARY KEY (id),
38+
CONSTRAINT chart_category_mapping_app_store_id_fkey FOREIGN KEY (app_store_id)
39+
REFERENCES public.app_store (id) MATCH SIMPLE
40+
ON UPDATE NO ACTION
41+
ON DELETE NO ACTION,
42+
CONSTRAINT chart_category_mapping_chart_category_id_fkey FOREIGN KEY (chart_category_id)
43+
REFERENCES public.chart_category (id) MATCH SIMPLE
44+
ON UPDATE NO ACTION
45+
ON DELETE NO ACTION
46+
);
47+
48+
49+
50+
CREATE SEQUENCE IF NOT EXISTS id_seq_infrastructure_installation;
51+
52+
CREATE TABLE infrastructure_installation (
53+
id int4 NOT NULL DEFAULT nextval('id_seq_infrastructure_installation'::regclass),
54+
installation_type VARCHAR(255),
55+
installed_entity_type VARCHAR(64),
56+
installed_entity_id INT ,
57+
installation_name VARCHAR(128),
58+
"created_on" timestamptz,
59+
"created_by" integer,
60+
"updated_on" timestamptz,
61+
"updated_by" integer,
62+
"active" boolean,
63+
PRIMARY KEY ("id")
64+
);
65+
66+
CREATE SEQUENCE IF NOT EXISTS id_seq_infrastructure_installation_versions;
67+
68+
CREATE TABLE infrastructure_installation_versions (
69+
id int4 NOT NULL DEFAULT nextval('id_seq_infrastructure_installation_versions'::regclass),
70+
infrastructure_installation_id INT,
71+
installation_config TEXT,
72+
action INT ,
73+
apply_status VARCHAR(100),
74+
apply_status_message VARCHAR(200),
75+
"created_on" timestamptz,
76+
"created_by" integer,
77+
"updated_on" timestamptz,
78+
"updated_by" integer,
79+
"active" boolean,
80+
PRIMARY KEY ("id"),
81+
CONSTRAINT infrastructure_installation_id_fkey
82+
FOREIGN KEY("infrastructure_installation_id")
83+
REFERENCES"public"."infrastructure_installation" ("id")
84+
);
85+
86+
87+
COMMIT;

0 commit comments

Comments
 (0)