RED-5481: Split jdbc-url field into multiple fields
Replaced the single jdbc-url field with multiple fields for each url part. This makes it possible to use just a part of the db-connection. We need the schema for multitenancy.
This commit is contained in:
parent
a32d2bbd41
commit
63741b08d6
@ -0,0 +1,27 @@
|
|||||||
|
package com.iqser.red.service.persistence.management.v1.processor.multitenancy.entity;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Embeddable;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Embeddable
|
||||||
|
public class DatabaseConnectionEntity {
|
||||||
|
|
||||||
|
@Column
|
||||||
|
private String jdbcDriver;
|
||||||
|
@Column
|
||||||
|
private String jdbcHost;
|
||||||
|
@Column
|
||||||
|
private String jdbcPort;
|
||||||
|
@Column
|
||||||
|
private String jdbcDatabase;
|
||||||
|
@Column
|
||||||
|
private String jdbcSchema;
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.iqser.red.service.persistence.management.v1.processor.multitenancy.entity;
|
package com.iqser.red.service.persistence.management.v1.processor.multitenancy.entity;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Embedded;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
@ -25,10 +26,11 @@ public class TenantEntity {
|
|||||||
@Column
|
@Column
|
||||||
private String guid;
|
private String guid;
|
||||||
@Column
|
@Column
|
||||||
private String jdbcUrl;
|
|
||||||
@Column
|
|
||||||
private String username;
|
private String username;
|
||||||
@Column
|
@Column
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
|
@Embedded
|
||||||
|
private DatabaseConnectionEntity databaseConnection;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3,3 +3,5 @@ databaseChangeLog:
|
|||||||
file: db/changelog/master/1-initial-schema.changelog.yaml
|
file: db/changelog/master/1-initial-schema.changelog.yaml
|
||||||
- include:
|
- include:
|
||||||
file: db/changelog/master/2-quartz.changelog.yaml
|
file: db/changelog/master/2-quartz.changelog.yaml
|
||||||
|
- include:
|
||||||
|
file: db/changelog/master/3-detailed-db-connection.changelog.yaml
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
databaseChangeLog:
|
||||||
|
- changeSet:
|
||||||
|
id: detailed-db-connection
|
||||||
|
author: viktorseifert
|
||||||
|
changes:
|
||||||
|
- deleteColumn:
|
||||||
|
columns:
|
||||||
|
- column:
|
||||||
|
name: jdbc_url
|
||||||
|
tableName: tenant
|
||||||
|
- addColumn:
|
||||||
|
columns:
|
||||||
|
- column:
|
||||||
|
name: jdbc_driver
|
||||||
|
type: VARCHAR(255)
|
||||||
|
constraints:
|
||||||
|
unique: true
|
||||||
|
uniqueConstraintName: UC_TENANT_CONNECTION
|
||||||
|
- column:
|
||||||
|
name: jdbc_host
|
||||||
|
type: VARCHAR(255)
|
||||||
|
constraints:
|
||||||
|
unique: true
|
||||||
|
uniqueConstraintName: UC_TENANT_CONNECTION
|
||||||
|
- column:
|
||||||
|
name: jdbc_port
|
||||||
|
type: VARCHAR(255)
|
||||||
|
constraints:
|
||||||
|
unique: true
|
||||||
|
uniqueConstraintName: UC_TENANT_CONNECTION
|
||||||
|
- column:
|
||||||
|
name: jdbc_database
|
||||||
|
type: VARCHAR(255)
|
||||||
|
constraints:
|
||||||
|
unique: true
|
||||||
|
uniqueConstraintName: UC_TENANT_CONNECTION
|
||||||
|
- column:
|
||||||
|
name: jdbc_schema
|
||||||
|
type: VARCHAR(255)
|
||||||
|
constraints:
|
||||||
|
unique: true
|
||||||
|
uniqueConstraintName: UC_TENANT_CONNECTION
|
||||||
|
tableName: tenant
|
||||||
Loading…
x
Reference in New Issue
Block a user