@@ -89,7 +89,7 @@ const createPublicationSqlize = ({
8989 publish_truncate ?: boolean
9090 tables ?: string [ ]
9191} ) => {
92- let tableClause : string = `FOR TABLE ${ tables ! . map ( ident ) . join ( ',' ) } `
92+ let tableClause : string = `FOR TABLE ${ tables ! . join ( ',' ) } `
9393 if ( tables === undefined ) {
9494 tableClause = 'FOR ALL TABLES'
9595 } else if ( tables . length === 0 ) {
@@ -145,7 +145,7 @@ const alterPublicationSqlize = ({
145145 // ---------|-----------|-----------------|
146146 // null | '' | 400 Bad Request |
147147 // old tables ---------|-----------|-----------------|
148- // string [] | '' | See below |
148+ // object [] | '' | See below |
149149 //
150150 // new tables
151151 //
@@ -161,15 +161,15 @@ const alterPublicationSqlize = ({
161161 } else if ( oldPublication . tables === null ) {
162162 throw Error ( 'Tables cannot be added to or dropped from FOR ALL TABLES publications' )
163163 } 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 ( ',' ) } `
167165 } else if ( oldPublication . tables . length === 0 ) {
168166 tableSql = ''
169167 } else {
170168 tableSql = `ALTER PUBLICATION ${ ident (
171169 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 ( ',' ) } `
173173 }
174174
175175 let publishOps = [ ]
0 commit comments