#1468 - ENH: Add built-in DDL generation for Postgres table partitioning (by day, week, month and year) (#1469)

This commit is contained in:
Rob Bygrave
2018-08-10 14:52:42 +12:00
committed by GitHub
parent db35f0f5ed
commit afb7679302
10 changed files with 444 additions and 21 deletions
@@ -434,6 +434,13 @@ public class MTable {
return partitionMeta != null;
}
/**
* Return the partition meta for this table.
*/
public PartitionMeta getPartitionMeta() {
return partitionMeta;
}
public void setPkName(String pkName) {
this.pkName = pkName;
}
@@ -546,6 +553,17 @@ public class MTable {
return pk;
}
/**
* Return the primary key column if it is a simple primary key.
*/
public String singlePrimaryKey() {
List<MColumn> columns = primaryKeyColumns();
if (columns.size() == 1) {
return columns.get(0).getName();
}
return null;
}
private void checkTableName(String tableName) {
if (!name.equals(tableName)) {
throw new IllegalArgumentException("addColumn tableName [" + tableName + "] does not match [" + name + "]");