From 40622297d017921932ed69d345b24dadfd1041f8 Mon Sep 17 00:00:00 2001 From: Mert E Date: Fri, 5 Jul 2024 17:54:23 +0300 Subject: [PATCH] feat: use text for SingleLineText & URL (#8933) --- .../nocodb-sdk/src/lib/sqlUi/DatabricksUi.ts | 4 +-- packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts | 24 ++++++++-------- packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts | 28 +++++++++---------- packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts | 10 +++---- packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts | 26 ++++++++--------- .../nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts | 26 ++++++++--------- 6 files changed, 59 insertions(+), 59 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/sqlUi/DatabricksUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/DatabricksUi.ts index 2ecccf0da0..5ac2d83aaf 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/DatabricksUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/DatabricksUi.ts @@ -58,7 +58,7 @@ export class DatabricksUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, dtxp: '', @@ -176,7 +176,7 @@ export class DatabricksUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, dtxp: '', diff --git a/packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts index e2473857c0..688d1c84a4 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts @@ -68,9 +68,9 @@ export class MssqlUi { { column_name: 'title', title: 'Title', - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -78,10 +78,10 @@ export class MssqlUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -187,9 +187,9 @@ export class MssqlUi { static getNewColumn(suffix) { return { column_name: 'title' + suffix, - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -197,10 +197,10 @@ export class MssqlUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -682,7 +682,7 @@ export class MssqlUi { colProp.dt = 'varchar'; break; case 'SingleLineText': - colProp.dt = 'varchar'; + colProp.dt = 'text'; break; case 'LongText': colProp.dt = 'text'; @@ -733,7 +733,7 @@ export class MssqlUi { }; break; case 'URL': - colProp.dt = 'varchar'; + colProp.dt = 'text'; colProp.validate = { func: ['isURL'], args: [''], @@ -819,7 +819,7 @@ export class MssqlUi { case 'Attachment': case 'Collaborator': case 'GeoData': - return ['char', 'ntext', 'text', 'varchar', 'nvarchar']; + return ['text', 'varchar', 'nvarchar', 'char', 'ntext']; case 'JSON': return ['text', 'ntext']; @@ -844,7 +844,7 @@ export class MssqlUi { return ['varchar']; case 'URL': - return ['varchar', 'text']; + return ['text', 'varchar']; case 'Number': return [ diff --git a/packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts index 50b559ab6f..29e925626c 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts @@ -72,9 +72,9 @@ export class MysqlUi { { column_name: 'title', title: 'Title', - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -82,10 +82,10 @@ export class MysqlUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -191,9 +191,9 @@ export class MysqlUi { static getNewColumn(suffix) { return { column_name: 'title' + suffix, - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -201,10 +201,10 @@ export class MysqlUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -1010,7 +1010,7 @@ export class MysqlUi { colProp.dt = 'varchar'; break; case 'SingleLineText': - colProp.dt = 'varchar'; + colProp.dt = 'text'; break; case 'LongText': colProp.dt = 'text'; @@ -1068,7 +1068,7 @@ export class MysqlUi { }; break; case 'URL': - colProp.dt = 'varchar'; + colProp.dt = 'text'; colProp.validate = { func: ['isURL'], args: [''], @@ -1157,13 +1157,13 @@ export class MysqlUi { case 'Collaborator': case 'GeoData': return [ - 'char', - 'varchar', - 'nchar', 'text', - 'tinytext', 'mediumtext', 'longtext', + 'varchar', + 'char', + 'nchar', + 'tinytext', ]; case 'Attachment': diff --git a/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts index 2c47a603f7..dda16b2cf3 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts @@ -31,9 +31,9 @@ export class OracleUi { { column_name: 'title', title: 'Title', - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -41,7 +41,7 @@ export class OracleUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, dtxp: '45', @@ -817,7 +817,7 @@ export class OracleUi { colProp.dt = 'varchar'; break; case 'SingleLineText': - colProp.dt = 'varchar'; + colProp.dt = 'clob'; break; case 'LongText': colProp.dt = 'clob'; @@ -869,7 +869,7 @@ export class OracleUi { }; break; case 'URL': - colProp.dt = 'varchar'; + colProp.dt = 'clob'; colProp.validate = { func: ['isURL'], args: [''], diff --git a/packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts index 95abb59a61..7ac63ae415 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts @@ -131,9 +131,9 @@ export class PgUi { { column_name: 'title', title: 'Title', - dt: 'character varying', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -141,10 +141,10 @@ export class PgUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -249,9 +249,9 @@ export class PgUi { static getNewColumn(suffix) { return { column_name: 'title' + suffix, - dt: 'character varying', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -259,10 +259,10 @@ export class PgUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -1632,7 +1632,7 @@ export class PgUi { colProp.dt = 'character varying'; break; case 'SingleLineText': - colProp.dt = 'character varying'; + colProp.dt = 'text'; break; case 'LongText': colProp.dt = 'text'; @@ -1683,7 +1683,7 @@ export class PgUi { }; break; case 'URL': - colProp.dt = 'character varying'; + colProp.dt = 'text'; colProp.validate = { func: ['isURL'], args: [''], @@ -1784,10 +1784,10 @@ export class PgUi { case 'LongText': case 'Collaborator': case 'GeoData': - return ['char', 'character', 'character varying', 'text']; + return ['text', 'character varying', 'char', 'character']; case 'Attachment': - return ['json', 'char', 'character', 'character varying', 'text']; + return ['json', 'text', 'char', 'character', 'character varying']; case 'JSON': return ['json', 'jsonb', 'text']; @@ -1838,7 +1838,7 @@ export class PgUi { return ['character varying']; case 'URL': - return ['character varying', 'text']; + return ['text', 'character varying']; case 'Number': return [ diff --git a/packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts index 533b7de7fc..275c060fa0 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts @@ -67,9 +67,9 @@ export class SnowflakeUi { { column_name: 'title', title: 'Title', - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -77,10 +77,10 @@ export class SnowflakeUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -185,9 +185,9 @@ export class SnowflakeUi { static getNewColumn(suffix) { return { column_name: 'title' + suffix, - dt: 'varchar', + dt: 'TEXT', dtx: 'specificType', - ct: 'varchar(45)', + ct: null, nrqd: true, rqd: false, ck: false, @@ -195,10 +195,10 @@ export class SnowflakeUi { un: false, ai: false, cdf: null, - clen: 45, + clen: null, np: null, ns: null, - dtxp: '45', + dtxp: '', dtxs: '', altered: 1, uidt: 'SingleLineText', @@ -726,7 +726,7 @@ export class SnowflakeUi { colProp.dt = 'VARCHAR'; break; case 'SingleLineText': - colProp.dt = 'VARCHAR'; + colProp.dt = 'TEXT'; break; case 'LongText': colProp.dt = 'TEXT'; @@ -776,7 +776,7 @@ export class SnowflakeUi { }; break; case 'URL': - colProp.dt = 'VARCHAR'; + colProp.dt = 'TEXT'; colProp.validate = { func: ['isURL'], args: [''], @@ -864,10 +864,10 @@ export class SnowflakeUi { case 'LongText': case 'Collaborator': case 'GeoData': - return ['CHAR', 'CHARACTER', 'VARCHAR', 'TEXT']; + return ['TEXT', 'VARCHAR', 'CHARACTER', 'CHAR']; case 'Attachment': - return ['TEXT', 'CHAR', 'CHARACTER', 'VARCHAR', 'text']; + return ['TEXT', 'CHAR', 'CHARACTER', 'VARCHAR']; case 'JSON': return ['TEXT']; @@ -891,7 +891,7 @@ export class SnowflakeUi { return ['VARCHAR']; case 'URL': - return ['VARCHAR', 'TEXT']; + return ['TEXT', 'VARCHAR']; case 'Number': return [