Maintenance - Mise à jour mensuelle Lundi 6 Avril 2020 entre 7h00 et 9h00

Commit db166805 authored by Celine Noirot's avatar Celine Noirot

MAJ db v2.0

parent 837e2b2b
......@@ -275,8 +275,8 @@ CREATE TABLE IF NOT EXISTS `fe_groups` (
`crdate` int(11) unsigned NOT NULL DEFAULT '0',
`cruser_id` int(11) unsigned NOT NULL DEFAULT '0',
`title` varchar(50) NOT NULL DEFAULT '',
`organism` varchar(50) NOT NULL DEFAULT '',
`location` varchar(50) NOT NULL DEFAULT '',
`tx_nG6_organism` varchar(50) NOT NULL DEFAULT '',
`tx_nG6_location` varchar(50) NOT NULL DEFAULT '',
`hidden` tinyint(3) unsigned NOT NULL DEFAULT '0',
`lockToDomain` varchar(50) NOT NULL DEFAULT '',
`deleted` tinyint(3) unsigned NOT NULL DEFAULT '0',
......
......@@ -59,7 +59,70 @@ class tx_nG6_upgrade {
* Main function to upgrade to version 2.0.
*/
function upgrade_2_0(){
// Update cruser_id of tx_nG6_project
$queryUpdateCruseridProject = "
UPDATE tx_nG6_project p
SET p.cruser_id = (
SELECT u.uid FROM fe_users u , fe_rights r
WHERE r.fe_user_id = u.uid
AND r.right_id = 2
AND r.project_id = p.uid
HAVING MIN(u.tstamp)
)
WHERE p.cruser_id = 0" ;
// Update cruser_id for tx_nG6_run table
$queryUpdateCruseridRun = "
UPDATE tx_nG6_run ru
SET ru.cruser_id = (
SELECT p.cruser_id FROM tx_nG6_project p , tx_nG6_project_run pr
WHERE p.uid = pr.project_id
AND pr.run_id=ru.uid
)
WHERE ru.cruser_id = 0 ";
// Update cruser_id for tx_nG6_analysis linked to a run
$queryUpdateCruseridAnalysisRun = "
UPDATE tx_nG6_analyze a
SET a.cruser_id = (
SELECT r.cruser_id FROM tx_nG6_run r , tx_nG6_run_analyze ra
WHERE a.uid = ra.analyze_id
AND ra.run_id = r.uid
)
WHERE a.cruser_id = 0";
// Update cruser_id for tx_nG6_analysis linked to a project
$queryUpdateCruseridAnalysisProject = "
UPDATE tx_nG6_analyze a
SET a.cruser_id = (
SELECT p.cruser_id FROM tx_nG6_project p , tx_nG6_project_analyze pa
WHERE a.uid = pa.analyze_id
AND pa.project_id = p.uid
)
WHERE a.cruser_id = 0";
// Alter table fe_groups and add two columns tx_nG6_location and tx_nG6_organism
$queryAlterFeGroups = "
ALTER TABLE fe_groups ADD tx_nG6_organism VARCHAR( 50 ) NOT NULL AFTER title ,
ADD tx_nG6_location VARCHAR( 50 ) NOT NULL AFTER tx_nG6_organism
" ;
// Alter tx_nG6_analyze and add is_editable
$queryAlterTxNG6Analayze = "
ALTER TABLE tx_nG6_analyze
ADD is_editable boolean NOT NULL DEFAULT FALSE AFTER params
";
/*
* Execute all queries
*/
$GLOBALS['TYPO3_DB']->sql_query($queryUpdateCruseridProject);
$GLOBALS['TYPO3_DB']->sql_query($queryUpdateCruseridRun);
$GLOBALS['TYPO3_DB']->sql_query($queryUpdateCruseridAnalysisRun);
$GLOBALS['TYPO3_DB']->sql_query($queryUpdateCruseridAnalysisProject);
$GLOBALS['TYPO3_DB']->sql_query($queryAlterFeGroups);
$GLOBALS['TYPO3_DB']->sql_query($queryAlterTxNG6Analayze);
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment