Skip to content
Snippets Groups Projects
Verified Commit f46254b4 authored by Damien's avatar Damien
Browse files

FEAT #11270 TIME 0:20 Custom fields: migration if field exist + default_value

parent d278366f
No related branches found
No related tags found
No related merge requests found
......@@ -29,6 +29,16 @@ foreach ($customs as $custom) {
if ($loadedXml) {
$i = 0;
foreach ($loadedXml->INDEX as $value) {
$customExists = \SrcCore\models\DatabaseModel::select([
'select' => [1],
'table' => ['doctypes_indexes'],
'where' => ['field_name = ?'],
'data' => [(string)$value->column]
]);
if (empty($customExists)) {
continue;
}
$label = (string)$value->label;
$type = (string)$value->type;
......@@ -67,5 +77,5 @@ foreach ($customs as $custom) {
}
}
printf("Migration Champs Custom (CUSTOM {$custom}) : " . $migrated . " Champs custom trouvé(s) et migré(s).\n");
printf("Migration Champs Custom (CUSTOM {$custom}) : " . $migrated . " Champs custom utilisé(s) et migré(s).\n");
}
......@@ -117,6 +117,7 @@ CREATE TABLE custom_fields
label character varying(256) NOT NULL,
type character varying(256) NOT NULL,
values jsonb,
default_value text,
CONSTRAINT custom_fields_pkey PRIMARY KEY (id),
CONSTRAINT custom_fields_unique_key UNIQUE (label)
)
......
......@@ -2010,6 +2010,7 @@ CREATE TABLE custom_fields
label character varying(256) NOT NULL,
type character varying(256) NOT NULL,
values jsonb,
default_value text,
CONSTRAINT custom_fields_pkey PRIMARY KEY (id),
CONSTRAINT custom_fields_unique_key UNIQUE (label)
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment