Add property behaviors migration (#790)

* Add behaviors migration

Add migration for behaviors.  Tested that the tables get altered correctly, names are set correctly.

Tested that I can place models, both regular and Brick-by-Brick ones and that they get deleted properly.  Tested that picking up models and re-placing them down properly updates them in the tables.

* Only update when empty
This commit is contained in:
David Markowitz
2022-10-31 15:31:49 -07:00
committed by GitHub
parent 89fb66c4a9
commit d4af7d76a2
3 changed files with 27 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
ALTER TABLE properties_contents
ADD COLUMN model_name TEXT NOT NULL DEFAULT "",
ADD COLUMN model_description TEXT NOT NULL DEFAULT "",
ADD COLUMN behavior_1 INT NOT NULL DEFAULT 0,
ADD COLUMN behavior_2 INT NOT NULL DEFAULT 0,
ADD COLUMN behavior_3 INT NOT NULL DEFAULT 0,
ADD COLUMN behavior_4 INT NOT NULL DEFAULT 0,
ADD COLUMN behavior_5 INT NOT NULL DEFAULT 0;
UPDATE properties_contents SET model_name = CONCAT("Objects_", lot, "_name") WHERE model_name = "";
CREATE TABLE IF NOT EXISTS behaviors (id INT NOT NULL, behavior_info TEXT NOT NULL);