Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
f46254b4
Verified
Commit
f46254b4
authored
5 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
migration/19.12/migrateCustomFields.php
+11
-1
11 additions, 1 deletion
migration/19.12/migrateCustomFields.php
sql/develop.sql
+1
-0
1 addition, 0 deletions
sql/develop.sql
sql/structure.sql
+1
-0
1 addition, 0 deletions
sql/structure.sql
with
13 additions
and
1 deletion
migration/19.12/migrateCustomFields.php
+
11
−
1
View file @
f46254b4
...
...
@@ -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
"
);
}
This diff is collapsed.
Click to expand it.
sql/develop.sql
+
1
−
0
View file @
f46254b4
...
...
@@ -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
)
)
...
...
This diff is collapsed.
Click to expand it.
sql/structure.sql
+
1
−
0
View file @
f46254b4
...
...
@@ -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
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment