Browse Source

fix: upgrader corrections and update NC_VERSION

pull/7304/head
Pranav C 11 months ago
parent
commit
72013a2642
  1. 2
      packages/nocodb/src/modules/global/init-meta-service.provider.ts
  2. 3
      packages/nocodb/src/version-upgrader/ncXcdbCreatedAndUpdatedTimeUpgrader.ts

2
packages/nocodb/src/modules/global/init-meta-service.provider.ts

@ -27,7 +27,7 @@ export const InitMetaServiceProvider: Provider = {
const config = await NcConfig.createByEnv(); const config = await NcConfig.createByEnv();
// set version // set version
process.env.NC_VERSION = '0111002'; process.env.NC_VERSION = '0111004';
// init cache // init cache
await NocoCache.init(); await NocoCache.init();

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

@ -8,7 +8,7 @@ import { Column, Model } from '~/models';
// An upgrader for upgrading created_at and updated_at columns // An upgrader for upgrading created_at and updated_at columns
// to system column and convert to new uidt CreatedTime and LastModifiedTime // to system column and convert to new uidt CreatedTime and LastModifiedTime
const logger = new Logger('XcdbCreatedAndUpdatedTimeUpgrader'); const logger = new Logger('ncXcdbCreatedAndUpdatedTimeUpgrader');
async function upgradeModels({ async function upgradeModels({
ncMeta, ncMeta,
@ -29,6 +29,7 @@ async function upgradeModels({
models.map(async (model: any) => { models.map(async (model: any) => {
const columns = await model.getColumns(ncMeta); const columns = await model.getColumns(ncMeta);
for (const column of columns) { for (const column of columns) {
if(column.uidt !== UITypes.DateTime) continue;
if (column.column_name === 'created_at') { if (column.column_name === 'created_at') {
await Column.update(column.id, { await Column.update(column.id, {
uidt: UITypes.CreatedTime, uidt: UITypes.CreatedTime,

Loading…
Cancel
Save