Skip to content

Commit 3536732

Browse files
committed
fix: Put constraintName on the table, not column
1 parent a4c8aa8 commit 3536732

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

lib/src/main/java/io/cloudquery/helper/ArrowHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ public static Schema toArrowSchema(Table table) {
149149
Map<String, String> metadata = new HashMap<>();
150150
metadata.put("cq:extension:unique", column.isUnique() ? "true" : "false");
151151
metadata.put("cq:extension:primary_key", column.isPrimaryKey() ? "true" : "false");
152-
if (column.getConstraintName() != null) {
153-
metadata.put("cq:extension:constraint_name", column.getConstraintName());
154-
}
155152
metadata.put("cq:extension:incremental", column.isIncrementalKey() ? "true" : "false");
156153
Field field =
157154
new Field(
@@ -171,6 +168,7 @@ public static Schema toArrowSchema(Table table) {
171168
if (table.getParent() != null) {
172169
metadata.put("cq:table_depends_on", table.getParent().getName());
173170
}
171+
metadata.put("cq:extension:constraint_name", table.getConstraintName());
174172
return new Schema(asList(fields), metadata);
175173
}
176174

lib/src/main/java/io/cloudquery/schema/Column.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
public class Column {
1111
private String name;
1212
private String description;
13-
private String constraintName;
1413
private ArrowType type;
1514
private ColumnResolver resolver;
1615
private boolean primaryKey;

lib/src/main/java/io/cloudquery/schema/Table.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ public static int maxDepth(List<Table> tables) {
121121
}
122122

123123
@NonNull private String name;
124+
@Builder.Default private String constraintName = "";
124125
private TableResolver resolver;
125126
private String title;
126127
private String description;

0 commit comments

Comments
 (0)