mirror of
https://github.com/stashapp/stash.git
synced 2026-02-09 08:55:19 +01:00
Add schema migration
This commit is contained in:
parent
08ba97bb8e
commit
d7bc47dc09
2 changed files with 10 additions and 1 deletions
|
|
@ -34,7 +34,7 @@ const (
|
|||
cacheSizeEnv = "STASH_SQLITE_CACHE_SIZE"
|
||||
)
|
||||
|
||||
var appSchemaVersion uint = 76
|
||||
var appSchemaVersion uint = 77
|
||||
|
||||
//go:embed migrations/*.sql
|
||||
var migrationsBox embed.FS
|
||||
|
|
|
|||
9
pkg/sqlite/migrations/77_tag_custom_fields.up.sql
Normal file
9
pkg/sqlite/migrations/77_tag_custom_fields.up.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
CREATE TABLE `tag_custom_fields` (
|
||||
`tag_id` integer NOT NULL,
|
||||
`field` varchar(64) NOT NULL,
|
||||
`value` BLOB NOT NULL,
|
||||
PRIMARY KEY (`tag_id`, `field`),
|
||||
foreign key(`tag_id`) references `tags`(`id`) on delete CASCADE
|
||||
);
|
||||
|
||||
CREATE INDEX `index_tag_custom_fields_field_value` ON `tag_custom_fields` (`field`, `value`);
|
||||
Loading…
Reference in a new issue