From 03c23472050817d8ec3fbc8e3282a537f218c52f Mon Sep 17 00:00:00 2001 From: Daniyal Arshad Date: Tue, 1 Oct 2024 15:38:29 -0400 Subject: [PATCH 1/2] Drop the editor feild from the workspaces table - Migration to remove editor column Changelog: changed EE: true --- ...0241001185217_remove_workspaces_editor_column.rb | 13 +++++++++++++ db/schema_migrations/20241001185217 | 1 + db/structure.sql | 2 -- 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 db/post_migrate/20241001185217_remove_workspaces_editor_column.rb create mode 100644 db/schema_migrations/20241001185217 diff --git a/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb b/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb new file mode 100644 index 00000000000000..06a91e2de1089b --- /dev/null +++ b/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveWorkspacesEditorColumn < Gitlab::Database::Migration[2.2] + milestone '17.6' + + def up + remove_column :workspaces, :editor + end + + def down + add_column :workspaces, :editor, :text, default: 'webide', null: false + end +end diff --git a/db/schema_migrations/20241001185217 b/db/schema_migrations/20241001185217 new file mode 100644 index 00000000000000..a7f81d70cc120f --- /dev/null +++ b/db/schema_migrations/20241001185217 @@ -0,0 +1 @@ +2f9540b1e1a298b20bcc5a6a284e293b5ec62cba0c851d33815c5e1cc48d6143 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 435803d0bd5275..d37449f76dd939 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -21338,7 +21338,6 @@ CREATE TABLE workspaces ( namespace text NOT NULL, desired_state text NOT NULL, actual_state text NOT NULL, - editor text DEFAULT 'webide'::text NOT NULL, devfile_ref text NOT NULL, devfile_path text NOT NULL, devfile text, @@ -21363,7 +21362,6 @@ CREATE TABLE workspaces ( CONSTRAINT check_8e4db5ffc2 CHECK ((char_length(actual_state) <= 32)), CONSTRAINT check_9e42558c35 CHECK ((char_length(url) <= 1024)), CONSTRAINT check_b70eddcbc1 CHECK ((char_length(desired_state) <= 32)), - CONSTRAINT check_d7ed376e49 CHECK ((char_length(editor) <= 256)), CONSTRAINT check_dc58d56169 CHECK ((char_length(devfile_path) <= 2048)), CONSTRAINT check_eb32879a3d CHECK ((char_length(devfile) <= 65535)), CONSTRAINT check_ffa8cad434 CHECK ((char_length(url_prefix) <= 256)) -- GitLab From c44465b78c4878ad273777fa022d39fcb685499a Mon Sep 17 00:00:00 2001 From: Daniyal Arshad Date: Tue, 22 Oct 2024 11:57:47 -0400 Subject: [PATCH 2/2] Add limit constraint to editor field on down method --- .../20241001185217_remove_workspaces_editor_column.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb b/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb index 06a91e2de1089b..5c74367d01c7ef 100644 --- a/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb +++ b/db/post_migrate/20241001185217_remove_workspaces_editor_column.rb @@ -8,6 +8,6 @@ def up end def down - add_column :workspaces, :editor, :text, default: 'webide', null: false + add_column :workspaces, :editor, :text, limit: 256, default: 'webide', null: false end end -- GitLab