chore: limit restore dialect (#3534)

This commit is contained in:
ChengLei Shao 2024-02-21 23:18:58 +08:00 committed by GitHub
parent 14b6c5a628
commit 85af594004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -17,6 +17,7 @@ export default class PostgresQueryInterface extends QueryInterface {
transaction?: Transaction; transaction?: Transaction;
}): Promise<void> { }): Promise<void> {
const { tableInfo, columnName, seqName, currentVal, transaction } = options; const { tableInfo, columnName, seqName, currentVal, transaction } = options;
if (!seqName) { if (!seqName) {
throw new Error('seqName is required to set auto increment val in postgres'); throw new Error('seqName is required to set auto increment val in postgres');
} }

View File

@ -91,7 +91,7 @@ export class Restorer extends AppMigrator {
async checkMeta() { async checkMeta() {
const meta = await this.getImportMeta(); const meta = await this.getImportMeta();
if (meta['dialectOnly'] && !this.app.db.inDialect(meta['dialect'])) { if (!this.app.db.inDialect(meta['dialect'])) {
throw new RestoreCheckError(`this backup file can only be imported in database ${meta['dialect']}`); throw new RestoreCheckError(`this backup file can only be imported in database ${meta['dialect']}`);
} }