Browse Source

fix: remove default value from CreatedTime field since it's programmatically generated

pull/7304/head
Pranav C 11 months ago
parent
commit
1240f9e5f3
  1. 3
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  2. 4
      packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts
  3. 3
      packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts
  4. 3
      packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts
  5. 3
      packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts
  6. 3
      packages/nocodb/src/version-upgrader/ncXcdbCreatedAndUpdatedTimeUpgrader.ts

3
packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts

@ -100,7 +100,7 @@ export class MssqlUi {
pk: false,
un: false,
ai: false,
cdf: 'GETDATE()',
cdf: '',
clen: 45,
np: null,
ns: null,
@ -736,7 +736,6 @@ export class MssqlUi {
break;
case 'CreatedTime':
colProp.dt = 'datetime';
colProp.cdf = 'GETDATE()';
break;
case 'LastModifiedTime':
colProp.dt = 'datetime';

4
packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts

@ -104,7 +104,7 @@ export class MysqlUi {
pk: false,
un: false,
ai: false,
cdf: 'CURRENT_TIMESTAMP',
cdf: '',
clen: 45,
np: null,
ns: null,
@ -1074,11 +1074,9 @@ export class MysqlUi {
break;
case 'CreatedTime':
colProp.dt = 'timestamp';
colProp.cdf = 'CURRENT_TIMESTAMP';
break;
case 'LastModifiedTime':
colProp.dt = 'timestamp';
colProp.cdf = 'CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP';
break;
case 'AutoNumber':
colProp.dt = 'int';

3
packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts

@ -163,7 +163,7 @@ export class PgUi {
pk: false,
un: false,
ai: false,
cdf: 'now()',
cdf: '',
clen: 45,
np: null,
ns: null,
@ -1687,7 +1687,6 @@ export class PgUi {
break;
case 'CreatedTime':
colProp.dt = 'timestamp';
colProp.cdf = 'now()';
break;
case 'LastModifiedTime':
colProp.dt = 'timestamp';

3
packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts

@ -99,7 +99,7 @@ export class SnowflakeUi {
pk: false,
un: false,
ai: false,
cdf: 'current_timestamp()',
cdf: '',
clen: 45,
np: null,
ns: null,
@ -778,7 +778,6 @@ export class SnowflakeUi {
break;
case 'CreatedTime':
colProp.dt = 'TIMESTAMP';
colProp.cdf = 'current_timestamp()';
break;
case 'LastModifiedTime':
colProp.dt = 'TIMESTAMP';

3
packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

@ -87,7 +87,7 @@ export class SqliteUi {
pk: false,
un: false,
ai: false,
cdf: 'CURRENT_TIMESTAMP',
cdf: '',
clen: 45,
np: null,
ns: null,
@ -629,7 +629,6 @@ export class SqliteUi {
break;
case 'CreatedTime':
colProp.dt = 'datetime';
colProp.cdf = 'CURRENT_TIMESTAMP';
break;
case 'LastModifiedTime':
colProp.dt = 'datetime';

3
packages/nocodb/src/version-upgrader/ncXcdbCreatedAndUpdatedTimeUpgrader.ts

@ -113,6 +113,7 @@ async function upgradeModels({
},
source,
)),
cdf: null,
system: true,
altered: Altered.NEW_COLUMN,
});
@ -125,10 +126,10 @@ async function upgradeModels({
uidt: UITypes.LastModifiedTime,
column_name: getUniqueColumnName(columns, 'updated_at'),
title: getUniqueColumnAliasName(columns, 'Updated At'),
cdf: null,
},
source,
)),
cdf: null,
system: true,
altered: Altered.NEW_COLUMN,
});

Loading…
Cancel
Save