Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simple_survey
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
simple_survey
Commits
de74bc52
Commit
de74bc52
authored
3 years ago
by
Kevin Rice
Browse files
Options
Downloads
Patches
Plain Diff
adds field storage updates
parent
d3f2a065
No related branches found
Branches containing commit
Tags
9098
Tags containing commit
1 merge request
!2
Resolve #3347809 "Add readme.md file"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
simple_survey.install
+49
-1
49 additions, 1 deletion
simple_survey.install
with
49 additions
and
1 deletion
simple_survey.install
+
49
−
1
View file @
de74bc52
...
...
@@ -38,4 +38,52 @@ function simple_survey_update_9003() {
$survey
->
set
(
'ombExpirationFormat'
,
'Y-m-d'
);
$survey
->
save
();
}
}
\ No newline at end of file
}
/**
* Updates Survey field.
*/
function
simple_survey_update_9004
()
{
$manager
=
\Drupal
::
entityDefinitionUpdateManager
();
if
(
$field
=
$manager
->
getFieldStorageDefinition
(
'survey'
,
'survey_response'
))
{
$manager
->
updateFieldStorageDefinition
(
$field
);
}
}
/**
* Updates created field storage definition.
*/
function
simple_survey_update_9005
()
{
$manager
=
\Drupal
::
entityDefinitionUpdateManager
();
if
(
$field
=
$manager
->
getFieldStorageDefinition
(
'created'
,
'survey_response'
))
{
$manager
->
updateFieldStorageDefinition
(
$field
);
}
}
/**
* Updates Send to BQ field storage definition.
*/
function
simple_survey_update_9006
()
{
$manager
=
\Drupal
::
entityDefinitionUpdateManager
();
if
(
$field
=
$manager
->
getFieldStorageDefinition
(
'sent_to_bq'
,
'survey_response'
))
{
$manager
->
updateFieldStorageDefinition
(
$field
);
}
}
/**
* Updates cookie uuid field storage definition.
*/
function
simple_survey_update_9007
()
{
$manager
=
\Drupal
::
entityDefinitionUpdateManager
();
\Drupal
::
database
()
->
update
(
'survey_response'
)
->
fields
([
'cookie_uuid'
=>
""
])
->
where
(
'ISNULL(cookie_uuid)'
)
->
execute
();
if
(
$field
=
$manager
->
getFieldStorageDefinition
(
'cookie_uuid'
,
'survey_response'
))
{
$manager
->
updateFieldStorageDefinition
(
$field
);
}
}
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