ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject git commit: Revert "AMBARI-3705. Update the DDL scripts to support upgrade to Config groups. (swagle)"
Date Fri, 08 Nov 2013 01:36:02 GMT
Updated Branches:
  refs/heads/trunk 4272cafaf -> 91c9c5a96


Revert "AMBARI-3705. Update the DDL scripts to support upgrade to Config groups. (swagle)"

This reverts commit 4272cafafd47d7b188edcf5e611ac32508331619.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/91c9c5a9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/91c9c5a9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/91c9c5a9

Branch: refs/heads/trunk
Commit: 91c9c5a96f465a864f9ae8fe6bd2086d63a0e150
Parents: 4272caf
Author: Siddharth Wagle <swagle@hortonworks.com>
Authored: Thu Nov 7 17:35:48 2013 -0800
Committer: Siddharth Wagle <swagle@hortonworks.com>
Committed: Thu Nov 7 17:35:48 2013 -0800

----------------------------------------------------------------------
 .../ConfigGroupConfigMappingEntity.java         |  2 +-
 .../main/resources/Ambari-DDL-Oracle-CREATE.sql |  9 ----
 .../resources/Ambari-DDL-Postgres-CREATE.sql    |  8 +--
 .../Ambari-DDL-Postgres-REMOTE-CREATE.sql       |  6 +--
 .../upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql   | 18 -------
 .../ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql   | 54 ++++++--------------
 6 files changed, 23 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/91c9c5a9/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigGroupConfigMappingEntity.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigGroupConfigMappingEntity.java
b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigGroupConfigMappingEntity.java
index a92526a..cc0a89f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigGroupConfigMappingEntity.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ConfigGroupConfigMappingEntity.java
@@ -29,7 +29,7 @@ import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
 @Entity
-@Table(name = "confgroupclusterconfigmapping")
+@Table(name = "configgroupclusterconfigmapping")
 @IdClass(ConfigGroupConfigMappingEntityPK.class)
 @NamedQueries({
   @NamedQuery(name = "configsByGroup", query =

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/91c9c5a9/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
index 25d82ef..c8d0065 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Oracle-CREATE.sql
@@ -43,9 +43,6 @@ CREATE TABLE metainfo ("metainfo_key" VARCHAR2(255) NOT NULL, "metainfo_value"
C
 CREATE TABLE ClusterHostMapping (cluster_id NUMBER(19) NOT NULL, host_name VARCHAR2(255)
NOT NULL, PRIMARY KEY (cluster_id, host_name));
 CREATE TABLE user_roles (role_name VARCHAR2(255) NOT NULL, user_id NUMBER(10) NOT NULL, PRIMARY
KEY (role_name, user_id));
 CREATE TABLE ambari_sequences (sequence_name VARCHAR2(50) NOT NULL, value NUMBER(38) NULL,
PRIMARY KEY (sequence_name));
-CREATE TABLE ambari.configgroup (group_id NUMBER(19), cluster_id NUMBER(19) NOT NULL, group_name
VARCHAR2(255) NOT NULL, tag VARCHAR2(1024) NOT NULL, description VARCHAR2(1024), create_timestamp
NUMBER(19) NOT NULL, PRIMARY KEY(group_id), UNIQUE(group_name));
-CREATE TABLE ambari.confgroupclusterconfigmapping (config_group_id NUMBER(19) NOT NULL, cluster_id
NUMBER(19) NOT NULL, config_type VARCHAR2(255) NOT NULL, version_tag VARCHAR2(255) NOT NULL,
user_name VARCHAR2(255) DEFAULT '_db', create_timestamp NUMBER(19) NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
-CREATE TABLE ambari.configgrouphostmapping (config_group_id NUMBER(19) NOT NULL, host_name
VARCHAR2(255) NOT NULL, PRIMARY KEY(config_group_id, host_name));
 
 
 ALTER TABLE users ADD CONSTRAINT UNQ_users_0 UNIQUE (user_name, ldap_user);
@@ -77,18 +74,12 @@ ALTER TABLE ClusterHostMapping ADD CONSTRAINT ClusterHostMapping_cluster_id
FORE
 ALTER TABLE ClusterHostMapping ADD CONSTRAINT ClusterHostMapping_host_name FOREIGN KEY (host_name)
REFERENCES hosts (host_name);
 ALTER TABLE user_roles ADD CONSTRAINT FK_user_roles_user_id FOREIGN KEY (user_id) REFERENCES
users (user_id);
 ALTER TABLE user_roles ADD CONSTRAINT FK_user_roles_role_name FOREIGN KEY (role_name) REFERENCES
roles (role_name);
-ALTER TABLE ambari.configgroup ADD CONSTRAINT FK_configgroup_cluster_id FOREIGN KEY (cluster_id)
REFERENCES ambari.clusters (cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
-ALTER TABLE ambari.confgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_configgroup_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
-ALTER TABLE ambari.confgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_host_name
FOREIGN KEY (host_name) REFERENCES ambari.hosts (host_name);
 
 
 
 INSERT INTO ambari_sequences(sequence_name, value) values ('host_role_command_id_seq', 0);
 INSERT INTO ambari_sequences(sequence_name, value) values ('user_id_seq', 1);
 INSERT INTO ambari_sequences(sequence_name, value) values ('cluster_id_seq', 0);
-INSERT INTO ambari_sequences(sequence_name, value) values ('configgroup_id_seq', 1);
 INSERT INTO metainfo("metainfo_key", "metainfo_value") values ('version', '${ambariVersion}');
 
 insert into Roles(role_name)

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/91c9c5a9/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
index 509ecb5..ff33085 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
@@ -113,8 +113,8 @@ GRANT ALL PRIVILEGES ON TABLE ambari.ambari_sequences TO :username;
 CREATE TABLE ambari.configgroup (group_id BIGINT, cluster_id BIGINT NOT NULL, group_name
VARCHAR(255) NOT NULL, tag VARCHAR(1024) NOT NULL, description VARCHAR(1024), create_timestamp
BIGINT NOT NULL, PRIMARY KEY(group_id), UNIQUE(group_name));
 GRANT ALL PRIVILEGES ON TABLE ambari.configgroup TO :username;
 
-CREATE TABLE ambari.confgroupclusterconfigmapping (config_group_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, config_type VARCHAR(255) NOT NULL, version_tag VARCHAR(255) NOT NULL, user_name
VARCHAR(255) DEFAULT '_db', create_timestamp BIGINT NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
-GRANT ALL PRIVILEGES ON TABLE ambari.confgroupclusterconfigmapping TO :username;
+CREATE TABLE ambari.configgroupclusterconfigmapping (config_group_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, config_type VARCHAR(255) NOT NULL, version_tag VARCHAR(255) NOT NULL, user_name
VARCHAR(255) DEFAULT '_db', create_timestamp BIGINT NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
+GRANT ALL PRIVILEGES ON TABLE ambari.configgroupclusterconfigmapping TO :username;
 
 CREATE TABLE ambari.configgrouphostmapping (config_group_id BIGINT NOT NULL, host_name VARCHAR(255)
NOT NULL, PRIMARY KEY(config_group_id, host_name));
 GRANT ALL PRIVILEGES ON TABLE ambari.configgrouphostmapping TO :username;
@@ -155,8 +155,8 @@ ALTER TABLE ambari.user_roles ADD CONSTRAINT FK_user_roles_role_name FOREIGN
KEY
 ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_cluster_id FOREIGN
KEY (cluster_id) REFERENCES ambari.clusters (cluster_id);
 ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_host_name FOREIGN
KEY (host_name) REFERENCES ambari.hosts (host_name);
 ALTER TABLE ambari.configgroup ADD CONSTRAINT FK_configgroup_cluster_id FOREIGN KEY (cluster_id)
REFERENCES ambari.clusters (cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
+ALTER TABLE ambari.configgroupclusterconfigmapping ADD CONSTRAINT FK_configgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
+ALTER TABLE ambari.configgroupclusterconfigmapping ADD CONSTRAINT FK_configgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
 ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_configgroup_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
 ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_host_name
FOREIGN KEY (host_name) REFERENCES ambari.hosts (host_name);
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/91c9c5a9/ambari-server/src/main/resources/Ambari-DDL-Postgres-REMOTE-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-Postgres-REMOTE-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-Postgres-REMOTE-CREATE.sql
index a216876..7c88d2a 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-Postgres-REMOTE-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-Postgres-REMOTE-CREATE.sql
@@ -47,7 +47,7 @@ CREATE TABLE ambari.hostconfigmapping (cluster_id bigint NOT NULL, host_name
VAR
 CREATE TABLE ambari.metainfo ("metainfo_key" VARCHAR(255), "metainfo_value" VARCHAR, PRIMARY
KEY("metainfo_key"));
 CREATE TABLE ambari.ambari_sequences (sequence_name VARCHAR(255) PRIMARY KEY, "value" BIGINT
NOT NULL);
 CREATE TABLE ambari.configgroup (group_id BIGINT, cluster_id BIGINT NOT NULL, group_name
VARCHAR(255) NOT NULL, tag VARCHAR(1024) NOT NULL, description VARCHAR(1024), create_timestamp
BIGINT NOT NULL, PRIMARY KEY(group_id), UNIQUE(group_name));
-CREATE TABLE ambari.confgroupclusterconfigmapping (config_group_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, config_type VARCHAR(255) NOT NULL, version_tag VARCHAR(255) NOT NULL, user_name
VARCHAR(255) DEFAULT '_db', create_timestamp BIGINT NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
+CREATE TABLE ambari.configgroupclusterconfigmapping (config_group_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, config_type VARCHAR(255) NOT NULL, version_tag VARCHAR(255) NOT NULL, user_name
VARCHAR(255) DEFAULT '_db', create_timestamp BIGINT NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
 CREATE TABLE ambari.configgrouphostmapping (config_group_id BIGINT NOT NULL, host_name VARCHAR(255)
NOT NULL, PRIMARY KEY(config_group_id, host_name));
 
 ALTER TABLE ambari.clusterconfig ADD CONSTRAINT FK_clusterconfig_cluster_id FOREIGN KEY (cluster_id)
REFERENCES ambari.clusters (cluster_id);
@@ -81,8 +81,8 @@ ALTER TABLE ambari.user_roles ADD CONSTRAINT FK_user_roles_role_name FOREIGN
KEY
 ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_cluster_id FOREIGN
KEY (cluster_id) REFERENCES ambari.clusters (cluster_id);
 ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_host_name FOREIGN
KEY (host_name) REFERENCES ambari.hosts (host_name);
 ALTER TABLE ambari.configgroup ADD CONSTRAINT FK_configgroup_cluster_id FOREIGN KEY (cluster_id)
REFERENCES ambari.clusters (cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
+ALTER TABLE ambari.configgroupclusterconfigmapping ADD CONSTRAINT FK_configgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
+ALTER TABLE ambari.configgroupclusterconfigmapping ADD CONSTRAINT FK_configgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
 ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_configgroup_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
 ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_host_name
FOREIGN KEY (host_name) REFERENCES ambari.hosts (host_name);
 

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/91c9c5a9/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql b/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql
index 2495bd7..c16a689 100644
--- a/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql
+++ b/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Oracle-UPGRADE.sql
@@ -27,22 +27,4 @@ ALTER TABLE hostconfigmapping ADD (user_name VARCHAR2 (255) DEFAULT '_db');
 --Upgrade version to current
 UPDATE metainfo SET "metainfo_key" = 'version', "metainfo_value" = '${ambariVersion}';
 
-INSERT INTO ambari_sequences(sequence_name, value) values ('configgroup_id_seq', 1);
-
--- drop deprecated tables componentconfigmapping and hostcomponentconfigmapping
--- not required after Config Group implementation
---DROP TABLE componentconfigmapping;
---DROP TABLE hostcomponentconfigmapping;
-
--- required for Config Group implementation
-CREATE TABLE ambari.configgroup (group_id BIGINT, cluster_id BIGINT NOT NULL, group_name
VARCHAR2(255) NOT NULL, tag VARCHAR2(1024) NOT NULL, description VARCHAR2(1024), create_timestamp
BIGINT NOT NULL, PRIMARY KEY(group_id), UNIQUE(group_name));
-CREATE TABLE ambari.confgroupclusterconfigmapping (config_group_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, config_type VARCHAR2(255) NOT NULL, version_tag VARCHAR2(255) NOT NULL, user_name
VARCHAR2(255) DEFAULT '_db', create_timestamp BIGINT NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
-CREATE TABLE ambari.configgrouphostmapping (config_group_id BIGINT NOT NULL, host_name VARCHAR2(255)
NOT NULL, PRIMARY KEY(config_group_id, host_name));
-
-ALTER TABLE ambari.configgroup ADD CONSTRAINT FK_configgroup_cluster_id FOREIGN KEY (cluster_id)
REFERENCES ambari.clusters (cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
-ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_configgroup_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
-ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_host_name
FOREIGN KEY (host_name) REFERENCES ambari.hosts (host_name);
-
 commit;

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/91c9c5a9/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
b/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
index 86dac17..4a211f9 100644
--- a/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
+++ b/ambari-server/src/main/resources/upgrade/ddl/Ambari-DDL-Postgres-UPGRADE-1.3.0.sql
@@ -54,7 +54,6 @@ ALTER TABLE ambari.hosts
 -- Upgrade to 1.3.0
 
 -- setting run-time search_path for :username
-ALTER SCHEMA ambari OWNER TO :username;
 ALTER ROLE :username SET search_path to 'ambari';
 
 --updating clusterstate table
@@ -73,36 +72,34 @@ ALTER TABLE ambari.hostconfigmapping ADD CONSTRAINT FK_hostconfigmapping_host_na
 ALTER TABLE ambari.stage ADD COLUMN request_context VARCHAR(255);
 
 -- portability changes for MySQL/Oracle support
-ALTER TABLE ambari.hostcomponentdesiredconfigmapping rename to hcdesiredconfigmapping;
-ALTER TABLE ambari.users ALTER column user_id DROP DEFAULT;
-ALTER TABLE ambari.users ALTER column ldap_user TYPE INTEGER USING CASE WHEN ldap_user=true
THEN 1 ELSE 0 END;
+alter table ambari.hostcomponentdesiredconfigmapping rename to hcdesiredconfigmapping;
+alter table ambari.users alter column user_id drop default;
+alter table ambari.users alter column ldap_user type INTEGER using case when ldap_user=true
then 1 else 0 END;
 
 --creating ambari_sequences table instead of deprecated sequences
 CREATE TABLE ambari.ambari_sequences (sequence_name VARCHAR(255) PRIMARY KEY, "value" BIGINT
NOT NULL);
 GRANT ALL PRIVILEGES ON TABLE ambari.ambari_sequences TO :username;
 
-INSERT INTO ambari.ambari_sequences(sequence_name, "value")
-  SELECT 'cluster_id_seq', nextval('ambari.clusters_cluster_id_seq')
-  UNION ALL
-  SELECT 'user_id_seq', nextval('ambari.users_user_id_seq')
-  UNION ALL
-  SELECT 'host_role_command_id_seq', COALESCE((SELECT max(task_id) FROM ambari.host_role_command),
1) + 50
-  UNION ALL
-  SELECT 'configgroup_id_seq', 1;
+insert into ambari.ambari_sequences(sequence_name, "value")
+  select 'cluster_id_seq', nextval('ambari.clusters_cluster_id_seq')
+  union all
+  select 'user_id_seq', nextval('ambari.users_user_id_seq')
+  union all
+  select 'host_role_command_id_seq', coalesce((select max(task_id) from ambari.host_role_command),
1) + 50;
 
-DROP sequence ambari.host_role_command_task_id_seq;
-DROP sequence ambari.users_user_id_seq;
-DROP sequence ambari.clusters_cluster_id_seq;
+drop sequence ambari.host_role_command_task_id_seq;
+drop sequence ambari.users_user_id_seq;
+drop sequence ambari.clusters_cluster_id_seq;
 
 --updating metainfo table
 CREATE TABLE ambari.metainfo (metainfo_key VARCHAR(255), metainfo_value VARCHAR, PRIMARY
KEY(metainfo_key));
-INSERT INTO ambari.metainfo (metainfo_key, metainfo_value) SELECT 'version', '${ambariVersion}';
+INSERT INTO ambari.metainfo (metainfo_key, metainfo_value) select 'version', '${ambariVersion}';
 UPDATE ambari.metainfo SET metainfo_value = '${ambariVersion}' WHERE metainfo_key = 'version';
 GRANT ALL PRIVILEGES ON TABLE ambari.metainfo TO :username;
 
 --replacing deprecated STOP_FAILED and START_FAILED states with INSTALLED
-UPDATE ambari.hostcomponentstate SET current_state = 'INSTALLED' WHERE current_state LIKE
'STOP_FAILED';
-UPDATE ambari.hostcomponentstate SET current_state = 'INSTALLED' WHERE current_state LIKE
'START_FAILED';
+UPDATE ambari.hostcomponentstate SET current_state = 'INSTALLED' WHERE current_state like
'STOP_FAILED';
+UPDATE ambari.hostcomponentstate SET current_state = 'INSTALLED' WHERE current_state like
'START_FAILED';
 
 --updating clusterconfigmapping table
 ALTER TABLE ambari.clusterconfigmapping
@@ -110,24 +107,3 @@ ALTER TABLE ambari.clusterconfigmapping
 SELECT update_clusterconfigmapping();
 GRANT ALL PRIVILEGES ON TABLE ambari.clusterconfigmapping TO :username;
 
--- drop deprecated tables componentconfigmapping and hostcomponentconfigmapping
--- not required after Config Group implementation
---DROP TABLE componentconfigmapping;
---DROP TABLE hostcomponentconfigmapping;
-
--- required for Config Group implementation
-CREATE TABLE ambari.configgroup (group_id BIGINT, cluster_id BIGINT NOT NULL, group_name
VARCHAR(255) NOT NULL, tag VARCHAR(1024) NOT NULL, description VARCHAR(1024), create_timestamp
BIGINT NOT NULL, PRIMARY KEY(group_id), UNIQUE(group_name));
-GRANT ALL PRIVILEGES ON TABLE ambari.configgroup TO :username;
-
-CREATE TABLE ambari.confgroupclusterconfigmapping (config_group_id BIGINT NOT NULL, cluster_id
BIGINT NOT NULL, config_type VARCHAR(255) NOT NULL, version_tag VARCHAR(255) NOT NULL, user_name
VARCHAR(255) DEFAULT '_db', create_timestamp BIGINT NOT NULL, PRIMARY KEY(config_group_id,
cluster_id, config_type));
-GRANT ALL PRIVILEGES ON TABLE ambari.confgroupclusterconfigmapping TO :username;
-
-CREATE TABLE ambari.configgrouphostmapping (config_group_id BIGINT NOT NULL, host_name VARCHAR(255)
NOT NULL, PRIMARY KEY(config_group_id, host_name));
-GRANT ALL PRIVILEGES ON TABLE ambari.configgrouphostmapping TO :username;
-
-ALTER TABLE ambari.configgroup ADD CONSTRAINT FK_configgroup_cluster_id FOREIGN KEY (cluster_id)
REFERENCES ambari.clusters (cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_config_tag
FOREIGN KEY (version_tag, config_type, cluster_id) REFERENCES ambari.clusterconfig (version_tag,
type_name, cluster_id);
-ALTER TABLE ambari.confgroupclusterconfigmapping ADD CONSTRAINT FK_confgroupclusterconfigmapping_group_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
-ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_configgroup_id
FOREIGN KEY (config_group_id) REFERENCES ambari.configgroup (group_id);
-ALTER TABLE ambari.configgrouphostmapping ADD CONSTRAINT FK_configgrouphostmapping_host_name
FOREIGN KEY (host_name) REFERENCES ambari.hosts (host_name);
-


Mime
View raw message