@@ -89,7 +89,7 @@ const createPublicationSqlize = ({
89
89
publish_truncate ?: boolean
90
90
tables ?: string [ ]
91
91
} ) => {
92
- let tableClause : string = `FOR TABLE ${ tables ! . map ( ident ) . join ( ',' ) } `
92
+ let tableClause : string = `FOR TABLE ${ tables ! . join ( ',' ) } `
93
93
if ( tables === undefined ) {
94
94
tableClause = 'FOR ALL TABLES'
95
95
} else if ( tables . length === 0 ) {
@@ -145,7 +145,7 @@ const alterPublicationSqlize = ({
145
145
// ---------|-----------|-----------------|
146
146
// null | '' | 400 Bad Request |
147
147
// old tables ---------|-----------|-----------------|
148
- // string [] | '' | See below |
148
+ // object [] | '' | See below |
149
149
//
150
150
// new tables
151
151
//
@@ -161,15 +161,15 @@ const alterPublicationSqlize = ({
161
161
} else if ( oldPublication . tables === null ) {
162
162
throw Error ( 'Tables cannot be added to or dropped from FOR ALL TABLES publications' )
163
163
} else if ( tables . length > 0 ) {
164
- tableSql = `ALTER PUBLICATION ${ ident ( oldPublication . name ) } SET TABLE ${ tables
165
- . map ( ident )
166
- . join ( ',' ) } `
164
+ tableSql = `ALTER PUBLICATION ${ ident ( oldPublication . name ) } SET TABLE ${ tables . join ( ',' ) } `
167
165
} else if ( oldPublication . tables . length === 0 ) {
168
166
tableSql = ''
169
167
} else {
170
168
tableSql = `ALTER PUBLICATION ${ ident (
171
169
oldPublication . name
172
- ) } DROP TABLE ${ oldPublication . tables . map ( ident ) . join ( ',' ) } `
170
+ ) } DROP TABLE ${ oldPublication . tables
171
+ . map ( ( table : any ) => `${ ident ( table . schema ) } .${ ident ( table . name ) } ` )
172
+ . join ( ',' ) } `
173
173
}
174
174
175
175
let publishOps = [ ]
0 commit comments