init push
This commit is contained in:
17
migrations/goose/20260533_facilities_electric_to_string.sql
Normal file
17
migrations/goose/20260533_facilities_electric_to_string.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
ALTER TABLE facilities
|
||||
MODIFY COLUMN electric VARCHAR(255) NOT NULL DEFAULT '';
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
UPDATE facilities
|
||||
SET electric = CASE
|
||||
WHEN LOWER(TRIM(electric)) IN ('', '0', 'false', 'no', 'n') THEN '0'
|
||||
ELSE '1'
|
||||
END;
|
||||
|
||||
ALTER TABLE facilities
|
||||
MODIFY COLUMN electric TINYINT(1) NOT NULL DEFAULT 0;
|
||||
-- +goose StatementEnd
|
||||
Reference in New Issue
Block a user