Skip to content

Commit

Permalink
0003815: Create tables with a source foreign key in a non default
Browse files Browse the repository at this point in the history
catalog and/or schema to a target with default catalog/schema
  • Loading branch information
jumpmind-josh committed Dec 3, 2018
1 parent c2b3b7f commit 9644005
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions symmetric-db/src/main/java/org/jumpmind/db/model/Table.java
Expand Up @@ -154,9 +154,15 @@ public String getCatalog() {
* The catalog
*/
public void setCatalog(String catalog) {
for (ForeignKey fk : getForeignKeys()) {
if (fk.getForeignTableCatalog() != null && fk.getForeignTableCatalog().equals(this.catalog)) {
fk.setForeignTableCatalog(catalog);
}
}
this.oldCatalog = this.catalog != null ? this.catalog : catalog;
this.catalog = catalog;
this.fullyQualifiedTableName = this.fullyQualifiedTableNameLowerCase = null;

}

/**
Expand All @@ -175,6 +181,11 @@ public String getSchema() {
* The schema
*/
public void setSchema(String schema) {
for (ForeignKey fk : getForeignKeys()) {
if (fk.getForeignTableSchema() != null && fk.getForeignTableSchema().equals(this.schema)) {
fk.setForeignTableSchema(schema);
}
}
this.oldSchema = this.schema != null ? this.schema : schema;
this.schema = schema;
this.fullyQualifiedTableName = this.fullyQualifiedTableNameLowerCase = null;
Expand Down

0 comments on commit 9644005

Please sign in to comment.