Browse Source

fix: setting new column to singleline text

Signed-off-by: Naveen MR <oof1lab@gmail.com>
pull/1884/head
Naveen MR 3 years ago
parent
commit
5703be3666
  1. 13
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  2. 35
      packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts
  3. 33
      packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts
  4. 13
      packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts
  5. 11
      packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

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

@ -138,10 +138,10 @@ export class MssqlUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'int', dt: 'varchar',
dtx: 'specificType', dtx: 'specificType',
ct: 'integer(11)', ct: 'varchar(45)',
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -152,11 +152,10 @@ export class MssqlUi {
clen: 45, clen: 45,
np: null, np: null,
ns: null, ns: null,
// data_type_x_specific: ' ', dtxp: '45',
dtxp: '', dtxs: '',
dtxs: ' ',
altered: 1, altered: 1,
uidt: 'Number', uidt: 'SingleLineText',
uip: '', uip: '',
uicn: '' uicn: ''
}; };

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

@ -46,8 +46,8 @@ export class MysqlUi {
static getNewTableColumns(): readonly any[] { static getNewTableColumns(): readonly any[] {
return [ return [
{ {
column_name: 'id', column_name: 'id',
title: 'Id', title: 'Id',
dt: 'int', dt: 'int',
dtx: 'integer', dtx: 'integer',
ct: 'int(11)', ct: 'int(11)',
@ -69,8 +69,8 @@ export class MysqlUi {
uicn: '' uicn: ''
}, },
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'varchar', dt: 'varchar',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: 'varchar(45)',
@ -92,8 +92,8 @@ export class MysqlUi {
uicn: '' uicn: ''
}, },
{ {
column_name: 'created_at', column_name: 'created_at',
title: 'CreatedAt', title: 'CreatedAt',
dt: 'timestamp', dt: 'timestamp',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: 'varchar(45)',
@ -115,8 +115,8 @@ export class MysqlUi {
uicn: '' uicn: ''
}, },
{ {
column_name: 'updated_at', column_name: 'updated_at',
title: 'UpdatedAt', title: 'UpdatedAt',
dt: 'timestamp', dt: 'timestamp',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: 'varchar(45)',
@ -142,10 +142,10 @@ export class MysqlUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'int', dt: 'varchar',
dtx: 'specificType', dtx: 'specificType',
ct: 'integer(11)', ct: 'varchar(45)',
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -156,11 +156,10 @@ export class MysqlUi {
clen: 45, clen: 45,
np: null, np: null,
ns: null, ns: null,
// data_type_x_specific: ' ', dtxp: '45',
dtxp: '11', dtxs: '',
dtxs: ' ',
altered: 1, altered: 1,
uidt: 'Number', uidt: 'SingleLineText',
uip: '', uip: '',
uicn: '' uicn: ''
}; };
@ -678,14 +677,14 @@ export class MysqlUi {
// set headers before settings result // set headers before settings result
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
const text = keys[i]; const text = keys[i];
headers.push({ text, value: text, sortable: false }); headers.push({text, value: text, sortable: false});
} }
} else { } else {
const keys = Object.keys(result); const keys = Object.keys(result);
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
const text = keys[i]; const text = keys[i];
if (typeof text !== 'function') { if (typeof text !== 'function') {
headers.push({ text, value: text, sortable: false }); headers.push({text, value: text, sortable: false});
} }
} }
result = [result]; result = [result];
@ -732,7 +731,7 @@ export class MysqlUi {
const column = { const column = {
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
np: 10, np: 10,
ns: 0, ns: 0,

33
packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts

@ -2,8 +2,8 @@ export class OracleUi {
static getNewTableColumns(): any[] { static getNewTableColumns(): any[] {
return [ return [
{ {
column_name: 'id', column_name: 'id',
title: 'Id', title: 'Id',
dt: 'integer', dt: 'integer',
dtx: 'integer', dtx: 'integer',
ct: 'int(11)', ct: 'int(11)',
@ -25,8 +25,8 @@ export class OracleUi {
uicn: '' uicn: ''
}, },
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'varchar', dt: 'varchar',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: 'varchar(45)',
@ -88,10 +88,10 @@ export class OracleUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'integer', dt: 'varchar',
dtx: 'specificType', dtx: 'specificType',
ct: 'integer(11)', ct: 'varchar(45)',
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -102,11 +102,10 @@ export class OracleUi {
clen: 45, clen: 45,
np: null, np: null,
ns: null, ns: null,
// data_type_x_specific: ' ', dtxp: '45',
dtxp: '11', dtxs: '',
dtxs: ' ',
altered: 1, altered: 1,
uidt: 'Number', uidt: 'SingleLineText',
uip: '', uip: '',
uicn: '' uicn: ''
}; };
@ -503,7 +502,7 @@ export class OracleUi {
columns.push({ columns.push({
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
dt: 'int', dt: 'int',
np: 10, np: 10,
@ -529,7 +528,7 @@ export class OracleUi {
columns.push({ columns.push({
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
dt: 'float', dt: 'float',
np: 10, np: 10,
@ -560,7 +559,7 @@ export class OracleUi {
columns.push({ columns.push({
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
dt: 'varchar', dt: 'varchar',
np: 45, np: 45,
@ -586,7 +585,7 @@ export class OracleUi {
columns.push({ columns.push({
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
dt: 'text', dt: 'text',
np: null, np: null,
@ -616,7 +615,7 @@ export class OracleUi {
columns.push({ columns.push({
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
dt: 'boolean', dt: 'boolean',
np: 3, np: 3,
@ -644,7 +643,7 @@ export class OracleUi {
columns.push({ columns.push({
dp: null, dp: null,
tn, tn,
column_name: keys[i], column_name: keys[i],
cno: keys[i], cno: keys[i],
dt: 'json', dt: 'json',
np: 3, np: 3,

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

@ -202,10 +202,10 @@ export class PgUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'int4', dt: 'character varying',
dtx: 'specificType', dtx: 'specificType',
ct: 'integer(11)', ct: 'varchar(45)',
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -216,11 +216,10 @@ export class PgUi {
clen: 45, clen: 45,
np: null, np: null,
ns: null, ns: null,
// data_type_x_specific: ' ', dtxp: '45',
dtxp: '11', dtxs: '',
dtxs: ' ',
altered: 1, altered: 1,
uidt: 'Number', uidt: 'SingleLineText',
uip: '', uip: '',
uicn: '' uicn: ''
}; };

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

@ -125,10 +125,10 @@ export class SqliteUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'integer', dt: 'varchar',
dtx: 'specificType', dtx: 'specificType',
ct: 'integer(11)', ct: 'varchar',
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -139,11 +139,10 @@ export class SqliteUi {
clen: 45, clen: 45,
np: null, np: null,
ns: null, ns: null,
// data_type_x_specific: ' ',
dtxp: '', dtxp: '',
dtxs: ' ', dtxs: '',
altered: 1, altered: 1,
uidt: 'Number', uidt: 'SingleLineText',
uip: '', uip: '',
uicn: '' uicn: ''
}; };

Loading…
Cancel
Save