You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/04/07 09:34:46 UTC

ambari git commit: revert BUG-34134 - [WinTP2] sql exception during cluster deploy

Repository: ambari
Updated Branches:
  refs/heads/trunk 3640b6cd6 -> 926e1586c


revert BUG-34134 - [WinTP2] sql exception during cluster deploy


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

Branch: refs/heads/trunk
Commit: 926e1586c207b3196198472e01e0a4f5cc656e1d
Parents: 3640b6c
Author: Artem Baranchuk <ab...@hortonworks.con>
Authored: Tue Apr 7 10:34:31 2015 +0300
Committer: Artem Baranchuk <ab...@hortonworks.con>
Committed: Tue Apr 7 10:34:31 2015 +0300

----------------------------------------------------------------------
 .../main/resources/Ambari-DDL-SQLServer-CREATE.sql | 17 +++--------------
 .../main/resources/Ambari-DDL-SQLServer-DROP.sql   |  2 --
 2 files changed, 3 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/926e1586/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
index 53bfb68..01c6a0c 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -40,19 +40,7 @@ CREATE TABLE clusterconfigmapping (cluster_id BIGINT NOT NULL, type_name VARCHAR
 CREATE TABLE clusterservices (service_name VARCHAR(255) NOT NULL, cluster_id BIGINT NOT NULL, service_enabled INTEGER NOT NULL, PRIMARY KEY CLUSTERED (service_name, cluster_id));
 CREATE TABLE clusterstate (cluster_id BIGINT NOT NULL, current_cluster_state VARCHAR(255) NOT NULL, current_stack_version VARCHAR(255) NOT NULL, PRIMARY KEY CLUSTERED (cluster_id));
 CREATE TABLE cluster_version (id BIGINT NOT NULL, cluster_id BIGINT NOT NULL, repo_version_id BIGINT NOT NULL, state VARCHAR(255) NOT NULL, start_time BIGINT NOT NULL, end_time BIGINT, user_name VARCHAR(255), PRIMARY KEY (id));
-
-CREATE TABLE hostcomponentdesiredstate (
-  cluster_id BIGINT NOT NULL,
-  component_name VARCHAR(255) NOT NULL,
-  desired_stack_version VARCHAR(255) NOT NULL,
-  desired_state VARCHAR(255) NOT NULL,
-  host_id BIGINT NOT NULL,
-  service_name VARCHAR(255) NOT NULL,
-  admin_state VARCHAR(32),
-  maintenance_state VARCHAR(32) NOT NULL,
-  security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED',
-  restart_required BIT NOT NULL DEFAULT 0,
-  PRIMARY KEY CLUSTERED (cluster_id, component_name, host_id, service_name));
+CREATE TABLE hostcomponentdesiredstate (cluster_id BIGINT NOT NULL, component_name VARCHAR(255) NOT NULL, desired_stack_version VARCHAR(255) NOT NULL, desired_state VARCHAR(255) NOT NULL, host_name VARCHAR(255) NOT NULL, service_name VARCHAR(255) NOT NULL, admin_state VARCHAR(32), maintenance_state VARCHAR(32) NOT NULL, security_state VARCHAR(32) NOT NULL DEFAULT 'UNSECURED', restart_required BIT NOT NULL DEFAULT 0, PRIMARY KEY CLUSTERED (cluster_id, component_name, host_name, service_name));
 
 CREATE TABLE hostcomponentstate (
   cluster_id BIGINT NOT NULL,
@@ -168,7 +156,8 @@ ALTER TABLE clusterconfigmapping ADD CONSTRAINT clusterconfigmappingcluster_id F
 ALTER TABLE clusterstate ADD CONSTRAINT FK_clusterstate_cluster_id FOREIGN KEY (cluster_id) REFERENCES clusters (cluster_id);
 ALTER TABLE cluster_version ADD CONSTRAINT FK_cluster_version_cluster_id FOREIGN KEY (cluster_id) REFERENCES clusters (cluster_id);
 ALTER TABLE cluster_version ADD CONSTRAINT FK_cluster_version_repovers_id FOREIGN KEY (repo_version_id) REFERENCES repo_version (repo_version_id);
-ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT hstcmponentdesiredstatehstid FOREIGN KEY (host_id) REFERENCES hosts (host_id);
+ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT hstcmponentdesiredstatehstname FOREIGN KEY (host_name) REFERENCES hosts (host_name);
+--ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT hstcmponentdesiredstatehstid FOREIGN KEY (host_id) REFERENCES hosts (host_id);
 ALTER TABLE hostcomponentdesiredstate ADD CONSTRAINT hstcmpnntdesiredstatecmpnntnme FOREIGN KEY (component_name, cluster_id, service_name) REFERENCES servicecomponentdesiredstate (component_name, cluster_id, service_name);
 ALTER TABLE hostcomponentstate ADD CONSTRAINT hstcomponentstatecomponentname FOREIGN KEY (component_name, cluster_id, service_name) REFERENCES servicecomponentdesiredstate (component_name, cluster_id, service_name);
 ALTER TABLE hostcomponentstate ADD CONSTRAINT FK_hostcomponentstate_host_id FOREIGN KEY (host_id) REFERENCES hosts (host_id);

http://git-wip-us.apache.org/repos/asf/ambari/blob/926e1586/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
index 06dca95..273a477 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
@@ -212,6 +212,4 @@ GO
 IF OBJECT_ID('repo_version', 'U') IS NOT NULL DROP TABLE repo_version
 GO
 IF OBJECT_ID('artifact', 'U') IS NOT NULL DROP TABLE artifact
-GO
-IF OBJECT_ID('stack', 'U') IS NOT NULL DROP TABLE stack
 GO
\ No newline at end of file