Version20150713132630.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V110;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Class Version20150713132630
  8. *
  9. * @package Application\Migrations\Schema\V11010
  10. */
  11. class Version20150713132630 extends AbstractMigrationChamilo
  12. {
  13. /**
  14. * @param Schema $schema
  15. */
  16. public function up(Schema $schema)
  17. {
  18. if ($schema->hasTable('c_student_publication')) {
  19. $this->addSql('ALTER TABLE c_student_publication ADD url_correction VARCHAR(255) DEFAULT NULL');
  20. $this->addSql('ALTER TABLE c_student_publication ADD title_correction VARCHAR(255) DEFAULT NULL');
  21. if (!$schema->getTable('c_student_publication')->hasColumn('document_id')) {
  22. $this->addSql(
  23. 'ALTER TABLE c_student_publication ADD document_id INT NOT NULL'
  24. );
  25. }
  26. }
  27. }
  28. /**
  29. * @param Schema $schema
  30. */
  31. public function down(Schema $schema)
  32. {
  33. $this->addSql('ALTER TABLE c_student_publication DROP url_correction');
  34. $this->addSql('ALTER TABLE c_student_publication DROP title_correction');
  35. $this->addSql('ALTER TABLE c_student_publication DROP document_id');
  36. }
  37. }