ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From abaranc...@apache.org
Subject ambari git commit: AMBARI-10362 - [WinTP2] sql exception during cluster deploy
Date Tue, 07 Apr 2015 07:35:56 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 926e1586c -> a88a155ee


AMBARI-10362 - [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/a88a155e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a88a155e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a88a155e

Branch: refs/heads/trunk
Commit: a88a155ee78472ec5e00454ec60c3f5ad55c31d0
Parents: 926e158
Author: Artem Baranchuk <abaranchuk@hortonworks.con>
Authored: Tue Apr 7 10:35:32 2015 +0300
Committer: Artem Baranchuk <abaranchuk@hortonworks.con>
Committed: Tue Apr 7 10:35:32 2015 +0300

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/a88a155e/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 01c6a0c..53bfb68 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-CREATE.sql
@@ -40,7 +40,19 @@ 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_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 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 hostcomponentstate (
   cluster_id BIGINT NOT NULL,
@@ -156,8 +168,7 @@ 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 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 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/a88a155e/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 273a477..06dca95 100644
--- a/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
+++ b/ambari-server/src/main/resources/Ambari-DDL-SQLServer-DROP.sql
@@ -212,4 +212,6 @@ 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


Mime
View raw message