Add sql 40/81940/1
authorsebdet <sebastien.determe@intl.att.com>
Mon, 11 Mar 2019 13:33:54 +0000 (14:33 +0100)
committersebdet <sebastien.determe@intl.att.com>
Mon, 11 Mar 2019 13:34:54 +0000 (14:34 +0100)
Add sql file to the project, so the csit can use the docker-compose

Change-Id: I1b7fd810d3686f686803b30ffce41823a2f3abd3
Issue-ID: CLAMP-299
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
extra/sql/bulkload/create-tables.sql [new file with mode: 0644]

diff --git a/extra/sql/bulkload/create-tables.sql b/extra/sql/bulkload/create-tables.sql
new file mode 100644 (file)
index 0000000..6d490c3
--- /dev/null
@@ -0,0 +1,70 @@
+
+    create table hibernate_sequence (
+       next_val bigint
+    ) engine=InnoDB;
+
+    insert into hibernate_sequence values ( 1 );
+
+    create table loop_logs (
+       id bigint not null,
+        log_instant datetime(6) not null,
+        log_type varchar(255) not null,
+        message varchar(255) not null,
+        loop_id varchar(255) not null,
+        primary key (id)
+    ) engine=InnoDB;
+
+    create table loops (
+       name varchar(255) not null,
+        blueprint_yaml varchar(255) not null,
+        dcae_blueprint_id varchar(255),
+        dcae_deployment_id varchar(255),
+        dcae_deployment_status_url varchar(255),
+        global_properties_json json,
+        last_computed_state varchar(255) not null,
+        model_properties_json json,
+        svg_representation varchar(255),
+        primary key (name)
+    ) engine=InnoDB;
+
+    create table loops_microservicepolicies (
+       loop_id varchar(255) not null,
+        microservicepolicy_id varchar(255) not null,
+        primary key (loop_id, microservicepolicy_id)
+    ) engine=InnoDB;
+
+    create table micro_service_policies (
+       name varchar(255) not null,
+        json_representation json not null,
+        policy_tosca varchar(255) not null,
+        properties json,
+        shared bit not null,
+        primary key (name)
+    ) engine=InnoDB;
+
+    create table operational_policies (
+       name varchar(255) not null,
+        configurations_json json,
+        loop_id varchar(255) not null,
+        primary key (name)
+    ) engine=InnoDB;
+
+    alter table loop_logs 
+       add constraint FK1j0cda46aickcaoxqoo34khg2 
+       foreign key (loop_id) 
+       references loops (name);
+
+    alter table loops_microservicepolicies 
+       add constraint FKem7tp1cdlpwe28av7ef91j1yl 
+       foreign key (microservicepolicy_id) 
+       references micro_service_policies (name);
+
+    alter table loops_microservicepolicies 
+       add constraint FKsvx91jekgdkfh34iaxtjfgebt 
+       foreign key (loop_id) 
+       references loops (name);
+
+    alter table operational_policies 
+       add constraint FK1ddoggk9ni2bnqighv6ecmuwu 
+       foreign key (loop_id) 
+       references loops (name);