Remove unused settings from database - refs #7792

1.10.x
Yannick Warnier 10 years ago
parent fe9c5f0031
commit 1fa4021da4
  1. 91
      app/Migrations/Schema/V110/Version20150813200000.php
  2. 8
      main/install/data.sql

@ -0,0 +1,91 @@
<?php
/* For licensing terms, see /license.txt */
namespace Application\Migrations\Schema\V110;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
/**
* Calendar color
*/
class Version20150813200000 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$entityManage = $this->getEntityManager();
$deleteOptions = $entityManage->createQueryBuilder();
$deleteSettings = $entityManage->createQueryBuilder();
$deleteOptions->delete('ChamiloCoreBundle:SettingsOptions', 'o')
->andWhere(
$deleteOptions->expr()->in(
'o.variable',
[
'math_mimetex',
'enabled_asciisvg'
]
)
);
$deleteOptions->getQuery()->execute();
$deleteSettings->delete('ChamiloCoreBundle:SettingsCurrent', 's')
->andWhere(
$deleteSettings->expr()->in(
's.variable',
[
'math_mimetex',
'enabled_asciisvg'
]
)
);
$deleteSettings->getQuery()->execute();
}
/**
* @param Schema $schema
*/
public function down(Schema $schema)
{
$this->addSettingCurrent(
'math_mimetex',
null,
'radio',
'Editor',
'false',
'MathMimetexTitle',
'MathMimetexComment',
null,
null,
1,
false,
true,
[
0 => ['value' => 'true', 'text' => 'Yes'],
1 => ['value' => 'false', 'text' => 'No']
]
);
$this->addSettingCurrent(
'enabled_asciisvg',
null,
'radio',
'Editor',
'false',
'AsciiSvgTitle',
'AsciiSvgComment',
null,
null,
1,
false,
true,
[
0 => ['value' => 'true', 'text' => 'Yes'],
1 => ['value' => 'false', 'text' => 'No']
]
);
}
}

@ -169,9 +169,7 @@ VALUES
('show_glossary_in_extra_tools', NULL, 'radio', 'Course', 'none', 'ShowGlossaryInExtraToolsTitle', 'ShowGlossaryInExtraToolsComment', NULL, NULL,1),
('send_email_to_admin_when_create_course',NULL,'radio','Platform','false','SendEmailToAdminTitle','SendEmailToAdminComment',NULL,NULL, 1),
('go_to_course_after_login',NULL,'radio','Course','false','GoToCourseAfterLoginTitle','GoToCourseAfterLoginComment',NULL,NULL, 0),
('math_mimetex',NULL,'radio','Editor','false','MathMimetexTitle','MathMimetexComment',NULL,NULL, 0),
('math_asciimathML',NULL,'radio','Editor','false','MathASCIImathMLTitle','MathASCIImathMLComment',NULL,NULL, 0),
('enabled_asciisvg',NULL,'radio','Editor','false','AsciiSvgTitle','AsciiSvgComment',NULL,NULL, 0),
('include_asciimathml_script',NULL,'radio','Editor','false','IncludeAsciiMathMlTitle','IncludeAsciiMathMlComment',NULL,NULL, 0),
('youtube_for_students',NULL,'radio','Editor','true','YoutubeForStudentsTitle','YoutubeForStudentsComment',NULL,NULL, 0),
('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
@ -477,12 +475,8 @@ VALUES
('send_email_to_admin_when_create_course','false','No'),
('go_to_course_after_login','true','Yes'),
('go_to_course_after_login','false','No'),
('math_mimetex','true','Yes'),
('math_mimetex','false','No'),
('math_asciimathML','true','Yes'),
('math_asciimathML','false','No'),
('enabled_asciisvg','true','Yes'),
('enabled_asciisvg','false','No'),
('include_asciimathml_script','true','Yes'),
('include_asciimathml_script','false','No'),
('youtube_for_students','true','Yes'),
@ -1816,4 +1810,4 @@ VALUES
('my_courses_view_by_session', 'true', 'Yes'),
('my_courses_view_by_session', 'false', 'No');
UPDATE settings_current SET selected_value = '1.10.0.49' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.50' WHERE variable = 'chamilo_database_version';

Loading…
Cancel
Save