mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-08-13 14:29:27 -07:00
Added device table migration for non-null model ID
Necessary to ensure database integrity becauses devices require being associated with a model and it no longer makes sense to do without. Milestone: minor
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ROM::SQL.migration do
|
||||
up { alter_table(:device) { set_column_not_null :model_id } }
|
||||
down { alter_table(:device) { set_column_allow_null :model_id } }
|
||||
end
|
||||
@@ -236,7 +236,7 @@ CREATE TABLE public.device (
|
||||
firmware_update boolean DEFAULT true CONSTRAINT devices_firmware_update_not_null NOT NULL,
|
||||
sleep_start_at time without time zone,
|
||||
sleep_stop_at time without time zone,
|
||||
model_id integer,
|
||||
model_id integer NOT NULL,
|
||||
playlist_id integer
|
||||
);
|
||||
|
||||
@@ -1316,4 +1316,5 @@ INSERT INTO schema_migrations (filename) VALUES
|
||||
('20251201105349_alter_model_firmware_columns.rb'),
|
||||
('20251211152911_drop_model_published_at_column.rb'),
|
||||
('20251215154654_add_playlist_mode_enum.rb'),
|
||||
('20260106144016_alter_firmware_kind.rb');
|
||||
('20260106144016_alter_firmware_kind.rb'),
|
||||
('20260126141642_alter_device_table_model_id_as_non_null.rb');
|
||||
|
||||
Reference in New Issue
Block a user