Skip to content

Commit 7e15a30

Browse files
authored
feat: Remove Unique constraint (support pks only) (#41)
1 parent b1b25a1 commit 7e15a30

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

plugins/source.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ func addInternalColumns(tables []*schema.Table) {
7070
cqId := schema.CqIdColumn
7171
if len(table.PrimaryKeys()) == 0 {
7272
cqId.CreationOptions.PrimaryKey = true
73-
cqId.CreationOptions.Unique = false
7473
}
7574
table.Columns = append(table.Columns, cqId, schema.CqFetchTime)
7675
addInternalColumns(table.Relations)

schema/column.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ type ColumnResolver func(ctx context.Context, meta ClientMeta, resource *Resourc
3737
// ColumnCreationOptions allow modification of how column is defined when table is created
3838
type ColumnCreationOptions struct {
3939
PrimaryKey bool `json:"primary_key,omitempty"`
40-
Unique bool `json:"unique,omitempty"`
41-
NotNull bool `json:"notnull,omitempty"`
4240
}
4341

4442
// Column definition for Table

schema/meta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Meta struct {
1717

1818
const FetchIdMetaKey = "cq_fetch_id"
1919

20-
var CqIdColumn = Column{Name: "_cq_id", Type: TypeUUID, Description: "Internal CQ ID of the row", CreationOptions: ColumnCreationOptions{Unique: true}, Resolver: CQUUIDResolver()}
20+
var CqIdColumn = Column{Name: "_cq_id", Type: TypeUUID, Description: "Internal CQ ID of the row", Resolver: CQUUIDResolver()}
2121
var CqFetchTime = Column{Name: "_cq_fetch_time", Type: TypeTimestamp, Description: "Internal CQ row of when fetch was started (this will be the same for all rows in a single fetch)"}
2222

2323
var CqColumns = []Column{

0 commit comments

Comments
 (0)