mirror of https://github.com/Fabio286/antares.git
fix(PostgreSQL): unable to change table comment to empty
This commit is contained in:
parent
ebd1a75445
commit
d78e59dd09
|
@ -921,7 +921,7 @@ export class PostgreSQLClient extends BaseClient {
|
||||||
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')}); `;
|
sql = `${sql} (${[...newColumns, ...newIndexes, ...newForeigns].join(', ')}); `;
|
||||||
if (manageIndexes.length) sql = `${sql} ${manageIndexes.join(';')}; `;
|
if (manageIndexes.length) sql = `${sql} ${manageIndexes.join(';')}; `;
|
||||||
// TABLE COMMENT
|
// TABLE COMMENT
|
||||||
if (options.comment) sql = `${sql} COMMENT ON TABLE "${schema}"."${options.name}" IS '${options.comment}'; `;
|
if (options.comment != null) sql = `${sql} COMMENT ON TABLE "${schema}"."${options.name}" IS '${options.comment}'; `;
|
||||||
// FIELDS COMMENT
|
// FIELDS COMMENT
|
||||||
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
||||||
|
|
||||||
|
@ -1066,7 +1066,7 @@ export class PostgreSQLClient extends BaseClient {
|
||||||
if (createSequences.length) sql = `${createSequences.join(';')}; ${sql}`;
|
if (createSequences.length) sql = `${createSequences.join(';')}; ${sql}`;
|
||||||
if (manageIndexes.length) sql = `${manageIndexes.join(';')}; ${sql}`;
|
if (manageIndexes.length) sql = `${manageIndexes.join(';')}; ${sql}`;
|
||||||
// TABLE COMMENT
|
// TABLE COMMENT
|
||||||
if (options.comment) sql = `${sql} COMMENT ON TABLE ${schema}.${table} IS '${options.comment}'; `;
|
if (options.comment != null) sql = `${sql} COMMENT ON TABLE ${schema}.${table} IS '${options.comment}'; `;
|
||||||
// FIELDS COMMENT
|
// FIELDS COMMENT
|
||||||
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
if (modifyComment.length) sql = `${sql} ${modifyComment.join(';')}; `;
|
||||||
if (options.name) sql += `ALTER TABLE "${schema}"."${table}" RENAME TO "${options.name}"; `;
|
if (options.name) sql += `ALTER TABLE "${schema}"."${table}" RENAME TO "${options.name}"; `;
|
||||||
|
|
Loading…
Reference in New Issue