Add missing schema migrations for custom fields

This commit is contained in:
Eike Kettner 2020-11-25 19:28:54 +01:00
parent a038836adf
commit 52c6659f9f
2 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,20 @@
CREATE TABLE "custom_field" (
"id" varchar(254) not null primary key,
"name" varchar(254) not null,
"label" varchar(254),
"cid" varchar(254) not null,
"ftype" varchar(100) not null,
"created" timestamp not null,
foreign key ("cid") references "collective"("cid"),
unique ("cid", "name")
);
CREATE TABLE "custom_field_value" (
"id" varchar(254) not null primary key,
"item_id" varchar(254) not null,
"field" varchar(254) not null,
"field_value" varchar(300) not null,
foreign key ("item_id") references "item"("itemid"),
foreign key ("field") references "custom_field"("id"),
unique ("item_id", "field")
)

View File

@ -0,0 +1,20 @@
CREATE TABLE `custom_field` (
`id` varchar(254) not null primary key,
`name` varchar(254) not null,
`label` varchar(254),
`cid` varchar(254) not null,
`ftype` varchar(100) not null,
`created` timestamp not null,
foreign key (`cid`) references `collective`(`cid`),
unique (`cid`, `name`)
);
CREATE TABLE `custom_field_value` (
`id` varchar(254) not null primary key,
`item_id` varchar(254) not null,
`field` varchar(254) not null,
`field_value` varchar(300) not null,
foreign key (`item_id`) references `item`(`itemid`),
foreign key (`field`) references `custom_field`(`id`),
unique (`item_id`, `field`)
)