Add post-update migration routine for custom profiles
This commit is contained in:
parent
2171cc8a32
commit
d9f7556b4a
2 changed files with 91 additions and 0 deletions
15
update.php
15
update.php
|
@ -430,3 +430,18 @@ function update_1330()
|
|||
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
||||
function update_1332()
|
||||
{
|
||||
$condition = ["`is-default` IS NOT NULL"];
|
||||
$profiles = DBA::select('profile', [], $condition);
|
||||
|
||||
while ($profile = DBA::fetch($profiles)) {
|
||||
DI::profileField()->migrateFromProfile($profile);
|
||||
}
|
||||
DBA::close($profiles);
|
||||
|
||||
DBA::update('contact', ['profile-id' => null], ['`profile-id` IS NOT NULL']);
|
||||
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue