LibraryElements: Enables creating library elements with specific UID (#39019)

* LibraryPanels: Enables create/update library panels with specific UID

* Chore: added check for uid length after PR comments

* Refactor: creates IsShortUIDTooLong function

* Refactor: adds UID to PATCH endpoint

* Refactor: clarifies the patch code

* Refactor: changes  after PR comments
This commit is contained in:
Hugo Häggmark
2021-09-10 11:22:13 +02:00
committed by GitHub
parent 580b03c952
commit fc73bc1161
9 changed files with 224 additions and 6 deletions

View File

@ -50,4 +50,8 @@ func addLibraryElementsMigrations(mg *migrator.Migrator) {
mg.AddMigration("create "+models.LibraryElementConnectionTableName+" table v1", migrator.NewAddTableMigration(libraryElementConnectionV1))
mg.AddMigration("add index "+models.LibraryElementConnectionTableName+" element_id-kind-connection_id", migrator.NewAddIndexMigration(libraryElementConnectionV1, libraryElementConnectionV1.Indices[0]))
mg.AddMigration("add unique index library_element org_id_uid", migrator.NewAddIndexMigration(libraryElementsV1, &migrator.Index{
Cols: []string{"org_id", "uid"}, Type: migrator.UniqueIndex,
}))
}