Version20150527114220.php 983 B

123456789101112131415161718192021222324252627282930313233
  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 Version20150527114220
  8. * Lp category
  9. * @package Application\Migrations\Schema\V11010
  10. */
  11. class Version20150527114220 extends AbstractMigrationChamilo
  12. {
  13. /**
  14. * @param Schema $schema
  15. */
  16. public function up(Schema $schema)
  17. {
  18. $this->addSql('CREATE TABLE c_lp_category (iid INT AUTO_INCREMENT NOT NULL, c_id INT NOT NULL, name VARCHAR(255) NOT NULL, position INT NOT NULL, PRIMARY KEY(iid)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
  19. $this->addSql('ALTER TABLE c_lp ADD category_id INT NOT NULL DEFAULT 0');
  20. }
  21. /**
  22. * @param Schema $schema
  23. */
  24. public function down(Schema $schema)
  25. {
  26. $this->addSql('DROP TABLE c_lp_category');
  27. $this->addSql('ALTER TABLE c_lp DROP category_id');
  28. }
  29. }