Add custom fields tables schema migration

This commit is contained in:
WithoutPants 2025-10-16 16:40:41 +11:00
parent 88eb46380c
commit 32220fd3b0
2 changed files with 10 additions and 1 deletions

View file

@ -34,7 +34,7 @@ const (
cacheSizeEnv = "STASH_SQLITE_CACHE_SIZE"
)
var appSchemaVersion uint = 75
var appSchemaVersion uint = 76
//go:embed migrations/*.sql
var migrationsBox embed.FS

View file

@ -0,0 +1,9 @@
CREATE TABLE `studio_custom_fields` (
`studio_id` integer NOT NULL,
`field` varchar(64) NOT NULL,
`value` BLOB NOT NULL,
PRIMARY KEY (`studio_id`, `field`),
foreign key(`studio_id`) references `studios`(`id`) on delete CASCADE
);
CREATE INDEX `index_studio_custom_fields_field_value` ON `studio_custom_fields` (`field`, `value`);