diff --git a/db/post_migrate/20231018083247_remove_users_email_opted_in_columns.rb b/db/post_migrate/20231018083247_remove_users_email_opted_in_columns.rb new file mode 100644 index 0000000000000000000000000000000000000000..a77ccb599df1b5d87afafe6a0bbe55e3ae63d2ec --- /dev/null +++ b/db/post_migrate/20231018083247_remove_users_email_opted_in_columns.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class RemoveUsersEmailOptedInColumns < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + remove_column :users, :email_opted_in + remove_column :users, :email_opted_in_ip + remove_column :users, :email_opted_in_source_id + remove_column :users, :email_opted_in_at + end + + # This migration removes columns. Disabling rule only for rollback action + # rubocop:disable Migration/AddColumnsToWideTables + def down + add_column :users, :email_opted_in, :boolean + add_column :users, :email_opted_in_ip, :string + add_column :users, :email_opted_in_source_id, :integer + add_column :users, :email_opted_in_at, :datetime_with_timezone + end + # rubocop:enable Migration/AddColumnsToWideTables +end diff --git a/db/post_migrate/20231018105749_remove_application_settings_marketing_emails_enabled_column.rb b/db/post_migrate/20231018105749_remove_application_settings_marketing_emails_enabled_column.rb new file mode 100644 index 0000000000000000000000000000000000000000..ea7ef21f1105eb16b2382cff5627fd00b5fc2b77 --- /dev/null +++ b/db/post_migrate/20231018105749_remove_application_settings_marketing_emails_enabled_column.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveApplicationSettingsMarketingEmailsEnabledColumn < Gitlab::Database::Migration[2.1] + def up + remove_column :application_settings, :in_product_marketing_emails_enabled + end + + def down + add_column :application_settings, :in_product_marketing_emails_enabled, :boolean, default: true, null: false + end +end diff --git a/db/schema_migrations/20231018083247 b/db/schema_migrations/20231018083247 new file mode 100644 index 0000000000000000000000000000000000000000..1807921c38837d9aa148622ed4b62115985b4c7e --- /dev/null +++ b/db/schema_migrations/20231018083247 @@ -0,0 +1 @@ +ccf25454919c35e8275f48aca973fdd263e57d643640878aa776a7760b38e851 \ No newline at end of file diff --git a/db/schema_migrations/20231018105749 b/db/schema_migrations/20231018105749 new file mode 100644 index 0000000000000000000000000000000000000000..fb443c9eb63bdc513de308b1af23fde098a7eacc --- /dev/null +++ b/db/schema_migrations/20231018105749 @@ -0,0 +1 @@ +4289e51e278d842ec0a7344256ed5c3de2b0a3355de6437b079b75e3a607b7a8 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index aa604cb665a49d92e65c81c6f5a36e07c4fc262f..8a770bc77b8de21dba294241fad2c43a85a187aa 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -11663,7 +11663,6 @@ CREATE TABLE application_settings ( notes_create_limit integer DEFAULT 300 NOT NULL, notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL, - in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL, asset_proxy_whitelist text, admin_mode boolean DEFAULT false NOT NULL, delayed_project_removal boolean DEFAULT false NOT NULL, @@ -24391,10 +24390,6 @@ CREATE TABLE users ( last_activity_on date, notified_of_own_activity boolean DEFAULT false, preferred_language character varying, - email_opted_in boolean, - email_opted_in_ip character varying, - email_opted_in_source_id integer, - email_opted_in_at timestamp without time zone, theme_id smallint, accepted_term_id integer, feed_token character varying,