ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmytro Sen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (AMBARI-22428) Update db schema to use service_id instead of service_name (requests part)
Date Tue, 19 Dec 2017 16:16:00 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-22428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dmytro Sen resolved AMBARI-22428.
---------------------------------
    Resolution: Fixed

Committed to branch-feature-AMBARI-14714

> Update db schema to use service_id instead of service_name (requests part)
> --------------------------------------------------------------------------
>
>                 Key: AMBARI-22428
>                 URL: https://issues.apache.org/jira/browse/AMBARI-22428
>             Project: Ambari
>          Issue Type: Task
>          Components: ambari-server
>    Affects Versions: 3.0.0
>            Reporter: Dmytro Sen
>            Assignee: Dmytro Sen
>            Priority: Critical
>             Fix For: 3.0.0
>
>
> As part of AMBARI-21824, we added {{id}} to {{clusterservices}} table. We updated tables
to use the service_id as foreign key instead of service_name. 
> https://github.com/apache/ambari/blob/branch-feature-AMBARI-14714/ambari-server/src/main/resources/Ambari-DDL-Postgres-CREATE.sql
> For example: 
> {code}
> CREATE TABLE servicecomponentdesiredstate (
>   id BIGINT NOT NULL,
>   component_name VARCHAR(255) NOT NULL,
>   cluster_id BIGINT NOT NULL,
>   service_group_id BIGINT NOT NULL,
>   service_id BIGINT NOT NULL,
>   desired_repo_version_id BIGINT NOT NULL,
>   desired_state VARCHAR(255) NOT NULL,
>   recovery_enabled SMALLINT NOT NULL DEFAULT 0,
>   repo_state VARCHAR(255) NOT NULL DEFAULT 'NOT_REQUIRED',
>   CONSTRAINT pk_sc_desiredstate PRIMARY KEY (id),
>   CONSTRAINT UQ_scdesiredstate_name UNIQUE(component_name, service_id, service_group_id,
cluster_id),
>   CONSTRAINT FK_scds_desired_repo_id FOREIGN KEY (desired_repo_version_id) REFERENCES
repo_version (repo_version_id),
>   CONSTRAINT srvccmponentdesiredstatesrvcnm FOREIGN KEY (service_id, service_group_id,
cluster_id) REFERENCES clusterservices (id, service_group_id, cluster_id));
> {code}
> We need to update other DB tables to use service_id instead of service_name. 
> For example: 
> {code}
> CREATE TABLE serviceconfig (
>   service_config_id BIGINT NOT NULL,
>   cluster_id BIGINT NOT NULL,
>   service_name VARCHAR(255) NOT NULL,
>   version BIGINT NOT NULL,
>   create_timestamp BIGINT NOT NULL,
>   stack_id BIGINT NOT NULL,
>   user_name VARCHAR(255) NOT NULL DEFAULT '_db',
>   group_id BIGINT,
>   note TEXT,
>   CONSTRAINT PK_serviceconfig PRIMARY KEY (service_config_id),
>   CONSTRAINT FK_serviceconfig_stack_id FOREIGN KEY (stack_id) REFERENCES stack(stack_id),
>   CONSTRAINT UQ_scv_service_version UNIQUE (cluster_id, service_name, version));
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message