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

FEAT #15350 TIME 1:00 New migrate which replace post-script sql

parent c5267e9c
No related branches found
No related tags found
No related merge requests found
-- *************************************************************************--
-- --
-- --
-- Model migration script - 20.03 to 20.10 (Run this file after migrate.sh) --
-- --
-- --
-- *************************************************************************--
DROP TABLE IF EXISTS saved_queries;
......@@ -11,4 +11,5 @@ php ./migrateTemplates.php
php ./migrateSavedQueries.php
php ./migrateSsoMapping.php
php ./migrateOpenLdapConfig.php
php ./migrateCustomXml.php # mettre en dernier
php ./migrateCustomXml.php # mettre en avant dernier
php ./migrateSQL.php # mettre en dernier
<?php
require '../../vendor/autoload.php';
chdir('../..');
$REQUESTS = [
"DROP TABLE IF EXISTS saved_queries"
];
if (is_file("apps/maarch_entreprise/xml/config.json")) {
\SrcCore\models\DatabasePDO::reset();
$db = new \SrcCore\models\DatabasePDO();
foreach ($REQUESTS as $query) {
$db->query($query);
}
}
$customs = scandir('custom');
foreach ($customs as $custom) {
if (in_array($custom, ['custom.json', 'custom.xml', '.', '..'])) {
continue;
}
if (is_file("custom/{$custom}/apps/maarch_entreprise/xml/config.json")) {
\SrcCore\models\DatabasePDO::reset();
$db = new \SrcCore\models\DatabasePDO(['customId' => $custom]);
foreach ($REQUESTS as $query) {
$db->query($query);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment