diff --git a/db/post_migrate/20250829190715_drop_unneeded_sequences.rb b/db/post_migrate/20250829190715_drop_unneeded_sequences.rb new file mode 100644 index 0000000000000000000000000000000000000000..fa1d4738b8388bc0720ea304ef9c6a5405b1ea5d --- /dev/null +++ b/db/post_migrate/20250829190715_drop_unneeded_sequences.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropUnneededSequences < Gitlab::Database::Migration[2.3] + disable_ddl_transaction! + milestone '18.4' + + def up + drop_sequence(:project_incident_management_settings, :project_id, + :project_incident_management_settings_project_id_seq) + drop_sequence(:user_statuses, :user_id, :user_statuses_user_id_seq) + end + + # NOP because these sequences were never used, and re-adding them + # causes the columns to be altered to use them as default values. + def down; end +end diff --git a/db/schema_migrations/20250829190715 b/db/schema_migrations/20250829190715 new file mode 100644 index 0000000000000000000000000000000000000000..32b079ba65ab2e6d1fe516659795412d6cbc46e1 --- /dev/null +++ b/db/schema_migrations/20250829190715 @@ -0,0 +1 @@ +e6a533e0e5a527061a339d742ea2783853b357c047ec1233cafa3fa81a17f2b1 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 2bf04772a30911f6bbf2f4bc73910147fdd20345..c19418f40bd3707ed31562c7975093d8124daf86 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22745,15 +22745,6 @@ CREATE TABLE project_incident_management_settings ( CONSTRAINT pagerduty_token_length_constraint CHECK ((octet_length(encrypted_pagerduty_token) <= 255)) ); -CREATE SEQUENCE project_incident_management_settings_project_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE project_incident_management_settings_project_id_seq OWNED BY project_incident_management_settings.project_id; - CREATE TABLE project_metrics_settings ( project_id bigint NOT NULL, external_dashboard_url character varying, @@ -26344,15 +26335,6 @@ CREATE TABLE user_statuses ( clear_status_at timestamp with time zone ); -CREATE SEQUENCE user_statuses_user_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE user_statuses_user_id_seq OWNED BY user_statuses.user_id; - CREATE TABLE user_synced_attributes_metadata ( id bigint NOT NULL, name_synced boolean DEFAULT false, @@ -29983,8 +29965,6 @@ ALTER TABLE ONLY project_group_links ALTER COLUMN id SET DEFAULT nextval('projec ALTER TABLE ONLY project_import_data ALTER COLUMN id SET DEFAULT nextval('project_import_data_id_seq'::regclass); -ALTER TABLE ONLY project_incident_management_settings ALTER COLUMN project_id SET DEFAULT nextval('project_incident_management_settings_project_id_seq'::regclass); - ALTER TABLE ONLY project_mirror_data ALTER COLUMN id SET DEFAULT nextval('project_mirror_data_id_seq'::regclass); ALTER TABLE ONLY project_relation_export_uploads ALTER COLUMN id SET DEFAULT nextval('project_relation_export_uploads_id_seq'::regclass); @@ -30275,8 +30255,6 @@ ALTER TABLE ONLY user_preferences ALTER COLUMN id SET DEFAULT nextval('user_pref ALTER TABLE ONLY user_project_callouts ALTER COLUMN id SET DEFAULT nextval('user_project_callouts_id_seq'::regclass); -ALTER TABLE ONLY user_statuses ALTER COLUMN user_id SET DEFAULT nextval('user_statuses_user_id_seq'::regclass); - ALTER TABLE ONLY user_synced_attributes_metadata ALTER COLUMN id SET DEFAULT nextval('user_synced_attributes_metadata_id_seq'::regclass); ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);