Skip to content

Commit 66e148c

Browse files
w3b6x9soedirgo
authored andcommitted
Fix: remove double quotes from publications create and update
1 parent 9d0dcba commit 66e148c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/PostgresMetaPublications.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default class PostgresMetaPublications {
6868
} else if (tables.length === 0) {
6969
tableClause = ''
7070
} else {
71-
tableClause = `FOR TABLE ${tables.map(ident).join(',')}`
71+
tableClause = `FOR TABLE ${tables.map(ident).join(',').replace(/"/g, '')}`
7272
}
7373

7474
let publishOps = []
@@ -138,7 +138,10 @@ CREATE PUBLICATION ${ident(name)} ${tableClause}
138138
} else if (old!.tables === null) {
139139
throw new Error('Tables cannot be added to or dropped from FOR ALL TABLES publications')
140140
} else if (tables.length > 0) {
141-
tableSql = `ALTER PUBLICATION ${ident(old!.name)} SET TABLE ${tables.map(ident).join(',')};`
141+
tableSql = `ALTER PUBLICATION ${ident(old!.name)} SET TABLE ${tables
142+
.map(ident)
143+
.join(',')
144+
.replace(/"/g, '')};`
142145
} else if (old!.tables.length === 0) {
143146
tableSql = ''
144147
} else {

0 commit comments

Comments
 (0)