Browse Source

fix: alter column types for form view

pull/7610/head
mertmit 10 months ago
parent
commit
956dbb9b47
  1. 4
      packages/nocodb/src/meta/migrations/XcMigrationSourcev2.ts
  2. 17
      packages/nocodb/src/meta/migrations/v2/nc_040_form_view_alter_column_types.ts
  3. 58
      packages/nocodb/src/schema/swagger-v2.json
  4. 58
      packages/nocodb/src/schema/swagger.json

4
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_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_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_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 // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {
@ -63,6 +64,7 @@ export default class XcMigrationSourcev2 {
'nc_037_rename_project_and_base', 'nc_037_rename_project_and_base',
'nc_038_formula_parsed_tree_column', 'nc_038_formula_parsed_tree_column',
'nc_039_sqlite_alter_column_types', '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; return nc_038_formula_parsed_tree_column;
case 'nc_039_sqlite_alter_column_types': case 'nc_039_sqlite_alter_column_types':
return 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;
} }
} }
} }

17
packages/nocodb/src/meta/migrations/v2/nc_039_form_view_filds.ts → 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) => { await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('subheading').alter(); 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) => { await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.text('label').alter(); table.text('label').alter();
}); });
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => { 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 }; export { up, down };

58
packages/nocodb/src/schema/swagger-v2.json

@ -12947,7 +12947,7 @@
} }
}, },
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"columns": { "columns": {
@ -12990,7 +12990,7 @@
"example": "collaborative" "example": "collaborative"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -13002,7 +13002,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -13010,7 +13010,7 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"type": "string", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form", "description": "The subheading of the form",
"example": "My Form Subheading" "example": "My Form Subheading"
}, },
@ -13019,7 +13019,7 @@
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
}, },
"title": { "title": {
@ -13053,7 +13053,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"email": { "email": {
@ -13067,7 +13067,7 @@
"type": "string" "type": "string"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -13079,7 +13079,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -13087,15 +13087,16 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form" "description": "The subheading of the form",
"example": "My Form Subheading"
}, },
"submit_another_form": { "submit_another_form": {
"$ref": "#/components/schemas/Bool", "$ref": "#/components/schemas/Bool",
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
} }
}, },
@ -13147,8 +13148,8 @@
"description": "Unique ID" "description": "Unique ID"
}, },
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"fk_column_id": { "fk_column_id": {
"$ref": "#/components/schemas/Id", "$ref": "#/components/schemas/Id",
@ -13159,11 +13160,11 @@
"description": "Foreign Key to View" "description": "Foreign Key to View"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -13232,15 +13233,15 @@
}, },
"properties": { "properties": {
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -16751,6 +16752,21 @@
"id": "8v8qzwm3w4v11" "id": "8v8qzwm3w4v11"
} }
}, },
"TextOrNull": {
"description": "Model for TextOrNull",
"examples": [
"string"
],
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "TextOrNull Model"
},
"StringOrNull": { "StringOrNull": {
"description": "Model for StringOrNull", "description": "Model for StringOrNull",
"examples": [ "examples": [

58
packages/nocodb/src/schema/swagger.json

@ -18193,7 +18193,7 @@
} }
}, },
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"columns": { "columns": {
@ -18236,7 +18236,7 @@
"example": "collaborative" "example": "collaborative"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -18248,7 +18248,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -18256,7 +18256,7 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"type": "string", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form", "description": "The subheading of the form",
"example": "My Form Subheading" "example": "My Form Subheading"
}, },
@ -18265,7 +18265,7 @@
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
}, },
"title": { "title": {
@ -18299,7 +18299,7 @@
"type": "object", "type": "object",
"properties": { "properties": {
"banner_image_url": { "banner_image_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Banner Image URL. Not in use currently." "description": "Banner Image URL. Not in use currently."
}, },
"email": { "email": {
@ -18313,7 +18313,7 @@
"type": "string" "type": "string"
}, },
"logo_url": { "logo_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Logo URL. Not in use currently." "description": "Logo URL. Not in use currently."
}, },
"meta": { "meta": {
@ -18325,7 +18325,7 @@
"description": "The numbers of seconds to redirect after form submission" "description": "The numbers of seconds to redirect after form submission"
}, },
"redirect_url": { "redirect_url": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "URL to redirect after submission" "description": "URL to redirect after submission"
}, },
"show_blank_form": { "show_blank_form": {
@ -18333,15 +18333,16 @@
"description": "Show `Blank Form` after 5 seconds" "description": "Show `Blank Form` after 5 seconds"
}, },
"subheading": { "subheading": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "The subheading of the form" "description": "The subheading of the form",
"example": "My Form Subheading"
}, },
"submit_another_form": { "submit_another_form": {
"$ref": "#/components/schemas/Bool", "$ref": "#/components/schemas/Bool",
"description": "Show `Submit Another Form` button" "description": "Show `Submit Another Form` button"
}, },
"success_msg": { "success_msg": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Custom message after the form is successfully submitted" "description": "Custom message after the form is successfully submitted"
} }
}, },
@ -18393,8 +18394,8 @@
"description": "Unique ID" "description": "Unique ID"
}, },
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"fk_column_id": { "fk_column_id": {
"$ref": "#/components/schemas/Id", "$ref": "#/components/schemas/Id",
@ -18405,11 +18406,11 @@
"description": "Foreign Key to View" "description": "Foreign Key to View"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -18478,15 +18479,15 @@
}, },
"properties": { "properties": {
"description": { "description": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Description (Not in use)" "description": "Form Column Description"
}, },
"help": { "help": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Help Text" "description": "Form Column Help Text (Not in use)"
}, },
"label": { "label": {
"$ref": "#/components/schemas/StringOrNull", "$ref": "#/components/schemas/TextOrNull",
"description": "Form Column Label" "description": "Form Column Label"
}, },
"meta": { "meta": {
@ -22007,6 +22008,21 @@
"id": "8v8qzwm3w4v11" "id": "8v8qzwm3w4v11"
} }
}, },
"TextOrNull": {
"description": "Model for TextOrNull",
"examples": [
"string"
],
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "TextOrNull Model"
},
"StringOrNull": { "StringOrNull": {
"description": "Model for StringOrNull", "description": "Model for StringOrNull",
"examples": [ "examples": [

Loading…
Cancel
Save