Version20171227120000.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V111;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Class Version20171227120000
  8. *
  9. * Fix more missing queries for migration from 1.10 to 1.11 (GH#2214)
  10. * These are minor changes caused by the move from static SQL to ORM entities
  11. *
  12. * @package Application\Migrations\Schema\V111
  13. */
  14. class Version20171227120000 extends AbstractMigrationChamilo
  15. {
  16. /**
  17. * @param Schema $schema
  18. */
  19. public function up(Schema $schema)
  20. {
  21. error_log('Version20171227120000');
  22. $this->addSql('ALTER TABLE access_url CHANGE description description LONGTEXT NOT NULL');
  23. $this->addSql('ALTER TABLE career CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
  24. $this->addSql('ALTER TABLE chat CHANGE sent sent DATETIME NOT NULL');
  25. $this->addSql('ALTER TABLE course_category CHANGE auth_course_child auth_course_child VARCHAR(40) DEFAULT NULL');
  26. $this->addSql('ALTER TABLE course_request CHANGE request_date request_date DATETIME NOT NULL');
  27. $this->addSql('ALTER TABLE extra_field CHANGE visible_to_self visible_to_self TINYINT DEFAULT NULL, CHANGE visible_to_others visible_to_others TINYINT DEFAULT NULL');
  28. $this->addSql('ALTER TABLE gradebook_certificate CHANGE created_at created_at DATETIME NOT NULL');
  29. $this->addSql('ALTER TABLE gradebook_evaluation CHANGE created_at created_at DATETIME NOT NULL');
  30. $this->addSql('ALTER TABLE gradebook_link CHANGE created_at created_at DATETIME NOT NULL');
  31. $this->addSql('ALTER TABLE gradebook_linkeval_log CHANGE created_at created_at DATETIME NOT NULL');
  32. $this->addSql('ALTER TABLE gradebook_result CHANGE created_at created_at DATETIME NOT NULL');
  33. $this->addSql('ALTER TABLE gradebook_result_log CHANGE created_at created_at DATETIME NOT NULL');
  34. // Fails because of FK on id field
  35. //$this->addSql('ALTER TABLE language CHANGE id id INT AUTO_INCREMENT NOT NULL');
  36. $this->addSql('ALTER TABLE message CHANGE send_date send_date DATETIME NOT NULL');
  37. $this->addSql('ALTER TABLE promotion CHANGE status status INT NOT NULL, CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
  38. $this->addSql('ALTER TABLE session CHANGE name name VARCHAR(150) NOT NULL');
  39. $this->addSql('ALTER TABLE session_rel_user CHANGE registered_at registered_at DATETIME NOT NULL');
  40. $this->addSql('ALTER TABLE shared_survey CHANGE creation_date creation_date DATETIME NOT NULL');
  41. $this->addSql('ALTER TABLE skill CHANGE updated_at updated_at DATETIME NOT NULL');
  42. $this->addSql('ALTER TABLE skill_rel_user_comment CHANGE skill_rel_user_id skill_rel_user_id INT DEFAULT NULL, CHANGE feedback_giver_id feedback_giver_id INT DEFAULT NULL, CHANGE feedback_text feedback_text LONGTEXT NOT NULL, CHANGE feedback_value feedback_value INT DEFAULT 1, CHANGE feedback_datetime feedback_datetime DATETIME NOT NULL');
  43. $this->addSql('ALTER TABLE sys_announcement CHANGE date_start date_start DATETIME NOT NULL, CHANGE date_end date_end DATETIME NOT NULL');
  44. $this->addSql('ALTER TABLE track_e_attempt_recording CHANGE insert_date insert_date DATETIME NOT NULL');
  45. $this->addSql('ALTER TABLE track_e_course_access CHANGE login_course_date login_course_date DATETIME NOT NULL');
  46. $this->addSql('ALTER TABLE track_e_downloads CHANGE down_date down_date DATETIME NOT NULL');
  47. $this->addSql('ALTER TABLE track_e_exercises CHANGE exe_date exe_date DATETIME NOT NULL, CHANGE start_date start_date DATETIME NOT NULL');
  48. $this->addSql('ALTER TABLE track_e_hotpotatoes CHANGE exe_date exe_date DATETIME NOT NULL');
  49. $this->addSql('ALTER TABLE track_e_item_property CHANGE lastedit_date lastedit_date DATETIME NOT NULL');
  50. $this->addSql('ALTER TABLE track_e_links CHANGE links_date links_date DATETIME NOT NULL');
  51. $this->addSql('ALTER TABLE track_e_online CHANGE login_date login_date DATETIME NOT NULL');
  52. $this->addSql('ALTER TABLE track_e_open CHANGE open_date open_date DATETIME NOT NULL');
  53. $this->addSql('ALTER TABLE track_e_uploads CHANGE upload_date upload_date DATETIME NOT NULL');
  54. $this->addSql('ALTER TABLE user CHANGE email_canonical email_canonical VARCHAR(100) NOT NULL, CHANGE credentials_expired credentials_expired TINYINT(1) NOT NULL');
  55. $this->addSql('ALTER TABLE c_attendance_calendar CHANGE date_time date_time DATETIME NOT NULL');
  56. $this->addSql('ALTER TABLE c_blog CHANGE date_creation date_creation DATETIME NOT NULL');
  57. $this->addSql('ALTER TABLE c_blog_comment CHANGE date_creation date_creation DATETIME NOT NULL');
  58. $this->addSql('ALTER TABLE c_blog_post CHANGE date_creation date_creation DATETIME NOT NULL');
  59. $this->addSql('ALTER TABLE c_blog_task_rel_user CHANGE target_date target_date DATE NOT NULL');
  60. $this->addSql('ALTER TABLE c_chat_connected CHANGE last_connection last_connection DATETIME NOT NULL');
  61. $this->addSql('ALTER TABLE c_dropbox_feedback CHANGE feedback_date feedback_date DATETIME NOT NULL');
  62. $this->addSql('ALTER TABLE c_dropbox_file CHANGE upload_date upload_date DATETIME NOT NULL, CHANGE last_upload_date last_upload_date DATETIME NOT NULL');
  63. $this->addSql('ALTER TABLE c_dropbox_post CHANGE feedback_date feedback_date DATETIME NOT NULL');
  64. $this->addSql('ALTER TABLE c_item_property CHANGE visibility visibility INT NOT NULL');
  65. $this->addSql('ALTER TABLE c_lp CHANGE created_on created_on DATETIME NOT NULL, CHANGE modified_on modified_on DATETIME NOT NULL');
  66. $this->addSql('ALTER TABLE c_notebook CHANGE creation_date creation_date DATETIME NOT NULL, CHANGE update_date update_date DATETIME NOT NULL');
  67. $this->addSql('ALTER TABLE c_online_connected CHANGE last_connection last_connection DATETIME NOT NULL');
  68. $this->addSql('ALTER TABLE c_quiz CHANGE hide_question_title hide_question_title TINYINT(1) DEFAULT NULL');
  69. $this->addSql('ALTER TABLE c_quiz_rel_category CHANGE category_id category_id INT DEFAULT NULL, CHANGE count_questions count_questions INT DEFAULT NULL');
  70. $this->addSql('ALTER TABLE c_survey CHANGE creation_date creation_date DATETIME NOT NULL');
  71. $this->addSql('ALTER TABLE c_survey_invitation CHANGE invitation_date invitation_date DATETIME NOT NULL, CHANGE reminder_date reminder_date DATETIME NOT NULL');
  72. $this->addSql('ALTER TABLE c_wiki_discuss CHANGE dtime dtime DATETIME NOT NULL');
  73. $this->addSql('ALTER TABLE skill_level CHANGE profile_id profile_id INT DEFAULT NULL, CHANGE position position INT NOT NULL, CHANGE short_name short_name VARCHAR(255) NOT NULL');
  74. }
  75. /**
  76. * @param Schema $schema
  77. */
  78. public function down(Schema $schema)
  79. {
  80. // No need to revert those database changes as they are minor.
  81. // There would be no real use to that
  82. }
  83. }