check default value

This commit is contained in:
Jan Prochazka 2024-10-29 15:05:43 +01:00
parent b2aa4d9377
commit a674b9b3a1

View File

@ -7,7 +7,7 @@ const crypto = require('crypto');
const { getAlterTableScript, extendDatabaseInfo, generateDbPairingId } = require('dbgate-tools');
function pickImportantTableInfo(engine, table) {
const props = ['columnName'];
const props = ['columnName', 'defaultValue'];
if (!engine.skipNullability) props.push('notNull');
if (!engine.skipAutoIncrement) props.push('autoIncrement');
return {
@ -141,7 +141,7 @@ describe('Alter table', () => {
'Add default value - %s',
testWrapper(async (conn, driver, engine) => {
await testTableDiff(engine, conn, driver, tbl => {
tbl.columns.find(x => x.columnName == 'col_std').defaultValue = 123;
tbl.columns.find(x => x.columnName == 'col_std').defaultValue = '123';
});
})
);
@ -159,7 +159,7 @@ describe('Alter table', () => {
'Change default value - %s',
testWrapper(async (conn, driver, engine) => {
await testTableDiff(engine, conn, driver, tbl => {
tbl.columns.find(x => x.columnName == 'col_def').defaultValue = 567;
tbl.columns.find(x => x.columnName == 'col_def').defaultValue = '567';
});
})
);