mirror of https://github.com/nocodb/nocodb
Browse Source
- Add upgrader to convert all existing Count and Autonumber to Number Signed-off-by: Pranav C <pranavxc@gmail.com>pull/4222/head
Pranav C
2 years ago
8 changed files with 17 additions and 13 deletions
@ -0,0 +1,14 @@
|
||||
import { UITypes } from 'nocodb-sdk'; |
||||
import { MetaTable } from '../utils/globals'; |
||||
import { NcUpgraderCtx } from './NcUpgrader'; |
||||
|
||||
// The Count and AutoNumber types are removed
|
||||
// so convert all existing Count and AutoNumber fields to Number type
|
||||
export default async function (ctx: NcUpgraderCtx) { |
||||
// directly update uidt of all existing Count and AutoNumber fields to Number
|
||||
await ctx.ncMeta.knex |
||||
.update({ uidt: UITypes.Number }) |
||||
.where({ uidt: UITypes.Count }) |
||||
.orWhere({ uidt: UITypes.AutoNumber }) |
||||
.table(MetaTable.COLUMNS); |
||||
} |
Loading…
Reference in new issue