Added screen migration to drop device ID and kind unique index

Necessary since this index wasn't unique enough and was causing conflicts with device IDs associated with extensions. There is no equivalent down action for this migration since you could get a unique index violation (as mentioned).

Issue: 360
Milestone: minor
This commit is contained in:
Brooke Kuhlmann
2026-08-10 10:36:44 -06:00
parent 43832d67be
commit 3603e65961
2 changed files with 5 additions and 8 deletions
@@ -0,0 +1,3 @@
# frozen_string_literal: true
ROM::SQL.migration { up { alter_table(:screen) { drop_index :device_id_kind } } }
+2 -8
View File
@@ -1465,13 +1465,6 @@ CREATE INDEX playlist_item_stop_at_index ON public.playlist_item USING btree (st
CREATE INDEX playlist_mode_index ON public.playlist USING btree (mode);
--
-- Name: screen_device_id_kind_index; Type: INDEX; Schema: public; Owner: -
--
CREATE UNIQUE INDEX screen_device_id_kind_index ON public.screen USING btree (device_id, kind) WHERE (device_id IS NOT NULL);
--
-- Name: screen_image_data_index; Type: INDEX; Schema: public; Owner: -
--
@@ -1816,4 +1809,5 @@ INSERT INTO schema_migrations (filename) VALUES
('20260721160734_add_device_command_column.rb'),
('20260721160742_rename_device_log_function_columan_as_command.rb'),
('20260805142625_alter_screen_device_id_constraint.rb'),
('20260810100653_add_screen_extension_id_column.rb');
('20260810100653_add_screen_extension_id_column.rb'),
('20260810102551_drop_screen_device_id_and_kind_index.rb');