From dffd52cbbfd93076071984c554a68d8677f9df0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Zapa=C5=82owicz?= Date: Fri, 9 Jul 2021 02:08:24 +0200 Subject: [PATCH] refactor: force underscores in target table names Podyn replicates the table names as they are in Dynamo. Yet at the same time postgres requires that table names with dashes are quoted. This commit makes podyn replace the dashes with underscores so that the table names can be used w/o quotation in pgsql. --- .../java/com/citusdata/migration/datamodel/TableSchema.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/citusdata/migration/datamodel/TableSchema.java b/src/main/java/com/citusdata/migration/datamodel/TableSchema.java index a097ddc..99f4bf3 100644 --- a/src/main/java/com/citusdata/migration/datamodel/TableSchema.java +++ b/src/main/java/com/citusdata/migration/datamodel/TableSchema.java @@ -24,11 +24,11 @@ public class TableSchema { private List tableIndexes; public TableSchema(String tableName) { - this(tableName, null); + this(tableName.replace("-","_"), null); } public TableSchema(String tableName, String schemaName) { - this.tableName = tableName; + this.tableName = tableName.replace("-","_"); this.schemaName = schemaName; this.columns = new LinkedHashMap<>(); this.primaryKey = null;