feat(db): properties_contents.placed_by, the character who placed a model

NULL is the owner (every model placed before this, and dashboard imports).
Read by GetPropertyModels and GetModel, written by InsertNewPropertyModel on
MySQL and SQLite, with a parity test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-28 12:08:29 -05:00
parent 462a152a66
commit bfa46408cb
6 changed files with 43 additions and 10 deletions

View File

@@ -0,0 +1,7 @@
/* properties_contents.placed_by is the character who placed the model (NULL: the property's owner, and every model
placed before this column). A model picked up by another player who can build there goes back to them. */
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE properties_contents ADD COLUMN placed_by BIGINT NULL DEFAULT NULL', 'DO 0') FROM information_schema.columns
WHERE table_schema = DATABASE() AND table_name = 'properties_contents' AND column_name = 'placed_by');
PREPARE dlu_column_stmt FROM @dlu_column;
EXECUTE dlu_column_stmt;
DEALLOCATE PREPARE dlu_column_stmt;

View File

@@ -0,0 +1,2 @@
/* The character who placed a property model (NULL: the owner). See the MySQL migration. */
ALTER TABLE properties_contents ADD COLUMN placed_by BIGINT DEFAULT NULL;