Postgres DDL - With Postgres table partitioning, add partition column to primary key

- Postgres DDL generation
- Using table partitioning
- There is a primary key defined that doesn't contain the partition column

In DDL generation, automatically add the partition column to the DB primary key.
This commit is contained in:
Rob Bygrave committed 2022-05-17 21:39:06 +12:00
1 parent 4f3c9adf6f
commit 7fbc1f8111
9 files changed
+305 -40

No files matched your search

@@ -16,11 +16,17 @@ public final class PartitionMeta {
return mode;
}
/**
* Originally the property name but replaced with the db column.
*/
public String getProperty() {
return property;
}
public void setProperty(String dbColumn) {
/**
* Set the db column being partitioned on.
*/
public void setColumn(String dbColumn) {
this.property = dbColumn;
}
}
@@ -249,12 +249,12 @@ public class DeployBeanDescriptor<T> {
if (partitionMeta != null) {
DeployBeanProperty beanProperty = getBeanProperty(partitionMeta.getProperty());
if (beanProperty != null) {
partitionMeta.setProperty(beanProperty.getDbColumn());
partitionMeta.setColumn(beanProperty.getDbColumn());
}
}
return partitionMeta;
}
public void setTablespaceMeta(TablespaceMeta tablespaceMeta) {
this.tablespaceMeta = tablespaceMeta;
}