diff --git a/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts b/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts index 0697a65891..6b950151c7 100644 --- a/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts +++ b/packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts @@ -26,6 +26,7 @@ import * as nc_036_base_deleted from '~/meta/migrations/v2/nc_036_base_deleted'; import * as nc_037_rename_project_and_base from '~/meta/migrations/v2/nc_037_rename_project_and_base'; import * as nc_038_formula_parsed_tree_column from '~/meta/migrations/v2/nc_038_formula_parsed_tree_column'; import * as nc_039_sqlite_alter_column_types from '~/meta/migrations/v2/nc_039_sqlite_alter_column_types'; +import * as nc_040_form_view_alter_column_types from '~/meta/migrations/v2/nc_040_form_view_alter_column_types'; // Create a custom migration source class export default class XcMigrationSourcev2 { @@ -63,6 +64,7 @@ export default class XcMigrationSourcev2 { 'nc_037_rename_project_and_base', 'nc_038_formula_parsed_tree_column', 'nc_039_sqlite_alter_column_types', + 'nc_040_form_view_alter_column_types', ]); } @@ -128,6 +130,8 @@ export default class XcMigrationSourcev2 { return nc_038_formula_parsed_tree_column; case 'nc_039_sqlite_alter_column_types': return nc_039_sqlite_alter_column_types; + case 'nc_040_form_view_alter_column_types': + return nc_040_form_view_alter_column_types; } } } diff --git a/packages/nocodb/src/meta/migrations/v2/nc_039_form_view_filds.ts b/packages/nocodb/src/meta/migrations/v2/nc_040_form_view_alter_column_types.ts similarity index 60% rename from packages/nocodb/src/meta/migrations/v2/nc_039_form_view_filds.ts rename to packages/nocodb/src/meta/migrations/v2/nc_040_form_view_alter_column_types.ts index 429a6a447c..7b5e54e7fb 100644 --- a/packages/nocodb/src/meta/migrations/v2/nc_039_form_view_filds.ts +++ b/packages/nocodb/src/meta/migrations/v2/nc_040_form_view_alter_column_types.ts @@ -5,17 +5,24 @@ const up = async (knex: Knex) => { await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => { table.text('subheading').alter(); }); - await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => { - table.text('success_msg').alter(); - }); await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => { table.text('label').alter(); }); await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => { - table.text('description').alter(); + table.text('help').alter(); }); }; -const down = async (knex: Knex) => {}; +const down = async (knex: Knex) => { + await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => { + table.string('subheading').alter(); + }); + await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => { + table.string('label').alter(); + }); + await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => { + table.string('help').alter(); + }); +}; export { up, down }; diff --git a/packages/nocodb/src/schema/swagger-v2.json b/packages/nocodb/src/schema/swagger-v2.json index 8d56161c39..2415b69d92 100644 --- a/packages/nocodb/src/schema/swagger-v2.json +++ b/packages/nocodb/src/schema/swagger-v2.json @@ -12947,7 +12947,7 @@ } }, "banner_image_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Banner Image URL. Not in use currently." }, "columns": { @@ -12990,7 +12990,7 @@ "example": "collaborative" }, "logo_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Logo URL. Not in use currently." }, "meta": { @@ -13002,7 +13002,7 @@ "description": "The numbers of seconds to redirect after form submission" }, "redirect_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "URL to redirect after submission" }, "show_blank_form": { @@ -13010,7 +13010,7 @@ "description": "Show `Blank Form` after 5 seconds" }, "subheading": { - "type": "string", + "$ref": "#/components/schemas/TextOrNull", "description": "The subheading of the form", "example": "My Form Subheading" }, @@ -13019,7 +13019,7 @@ "description": "Show `Submit Another Form` button" }, "success_msg": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Custom message after the form is successfully submitted" }, "title": { @@ -13053,7 +13053,7 @@ "type": "object", "properties": { "banner_image_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Banner Image URL. Not in use currently." }, "email": { @@ -13067,7 +13067,7 @@ "type": "string" }, "logo_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Logo URL. Not in use currently." }, "meta": { @@ -13079,7 +13079,7 @@ "description": "The numbers of seconds to redirect after form submission" }, "redirect_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "URL to redirect after submission" }, "show_blank_form": { @@ -13087,15 +13087,16 @@ "description": "Show `Blank Form` after 5 seconds" }, "subheading": { - "$ref": "#/components/schemas/StringOrNull", - "description": "The subheading of the form" + "$ref": "#/components/schemas/TextOrNull", + "description": "The subheading of the form", + "example": "My Form Subheading" }, "submit_another_form": { "$ref": "#/components/schemas/Bool", "description": "Show `Submit Another Form` button" }, "success_msg": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Custom message after the form is successfully submitted" } }, @@ -13147,8 +13148,8 @@ "description": "Unique ID" }, "description": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Description (Not in use)" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Description" }, "fk_column_id": { "$ref": "#/components/schemas/Id", @@ -13159,11 +13160,11 @@ "description": "Foreign Key to View" }, "help": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Help Text" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Help Text (Not in use)" }, "label": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Form Column Label" }, "meta": { @@ -13232,15 +13233,15 @@ }, "properties": { "description": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Description (Not in use)" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Description" }, "help": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Help Text" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Help Text (Not in use)" }, "label": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Form Column Label" }, "meta": { @@ -16751,6 +16752,21 @@ "id": "8v8qzwm3w4v11" } }, + "TextOrNull": { + "description": "Model for TextOrNull", + "examples": [ + "string" + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "TextOrNull Model" + }, "StringOrNull": { "description": "Model for StringOrNull", "examples": [ diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index 74d7f89def..7763bc4abf 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -18193,7 +18193,7 @@ } }, "banner_image_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Banner Image URL. Not in use currently." }, "columns": { @@ -18236,7 +18236,7 @@ "example": "collaborative" }, "logo_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Logo URL. Not in use currently." }, "meta": { @@ -18248,7 +18248,7 @@ "description": "The numbers of seconds to redirect after form submission" }, "redirect_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "URL to redirect after submission" }, "show_blank_form": { @@ -18256,7 +18256,7 @@ "description": "Show `Blank Form` after 5 seconds" }, "subheading": { - "type": "string", + "$ref": "#/components/schemas/TextOrNull", "description": "The subheading of the form", "example": "My Form Subheading" }, @@ -18265,7 +18265,7 @@ "description": "Show `Submit Another Form` button" }, "success_msg": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Custom message after the form is successfully submitted" }, "title": { @@ -18299,7 +18299,7 @@ "type": "object", "properties": { "banner_image_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Banner Image URL. Not in use currently." }, "email": { @@ -18313,7 +18313,7 @@ "type": "string" }, "logo_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Logo URL. Not in use currently." }, "meta": { @@ -18325,7 +18325,7 @@ "description": "The numbers of seconds to redirect after form submission" }, "redirect_url": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "URL to redirect after submission" }, "show_blank_form": { @@ -18333,15 +18333,16 @@ "description": "Show `Blank Form` after 5 seconds" }, "subheading": { - "$ref": "#/components/schemas/StringOrNull", - "description": "The subheading of the form" + "$ref": "#/components/schemas/TextOrNull", + "description": "The subheading of the form", + "example": "My Form Subheading" }, "submit_another_form": { "$ref": "#/components/schemas/Bool", "description": "Show `Submit Another Form` button" }, "success_msg": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Custom message after the form is successfully submitted" } }, @@ -18393,8 +18394,8 @@ "description": "Unique ID" }, "description": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Description (Not in use)" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Description" }, "fk_column_id": { "$ref": "#/components/schemas/Id", @@ -18405,11 +18406,11 @@ "description": "Foreign Key to View" }, "help": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Help Text" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Help Text (Not in use)" }, "label": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Form Column Label" }, "meta": { @@ -18478,15 +18479,15 @@ }, "properties": { "description": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Description (Not in use)" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Description" }, "help": { - "$ref": "#/components/schemas/StringOrNull", - "description": "Form Column Help Text" + "$ref": "#/components/schemas/TextOrNull", + "description": "Form Column Help Text (Not in use)" }, "label": { - "$ref": "#/components/schemas/StringOrNull", + "$ref": "#/components/schemas/TextOrNull", "description": "Form Column Label" }, "meta": { @@ -22007,6 +22008,21 @@ "id": "8v8qzwm3w4v11" } }, + "TextOrNull": { + "description": "Model for TextOrNull", + "examples": [ + "string" + ], + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "TextOrNull Model" + }, "StringOrNull": { "description": "Model for StringOrNull", "examples": [