migrations for the roomtypes (#513)

* migrations for the roomtypes

* rename files

* updated types

* Correct migration numbers and cleanup
This commit is contained in:
Arwid Thornström
2025-12-16 10:40:30 +01:00
committed by GitHub
parent e32c6de5af
commit fbe3bb77fc
4 changed files with 534 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
-- Truncate roomtypes table and reset sequence to start fresh
TRUNCATE TABLE roomtypes RESTART IDENTITY CASCADE;
-- Insert all room types in the desired order with sequential IDs
INSERT INTO roomtypes (name) VALUES
('dining-room'), -- id 1
('living-room'), -- id 2
('kids-room'), -- id 3
('bedroom'), -- id 4
('office'), -- id 5
('baby-room'), -- id 6
('hallway'), -- id 7
('teen-room'), -- id 8
('bathroom'), -- id 9
('kitchen'), -- id 10
('ceiling'), -- id 11
('close-up'); -- id 12
UPDATE roomtypes SET admin_specific = TRUE WHERE name IN ('close-up');
-- Truncate room_roomtypes table to start fresh
TRUNCATE TABLE room_roomtypes;