parent
046553d14b
commit
1bb10318ce
@ -0,0 +1,44 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
/* For licensing terms, see /license.txt */ |
||||||
|
|
||||||
|
declare(strict_types=1); |
||||||
|
|
||||||
|
namespace Chamilo\CoreBundle\Migrations\Schema\V200; |
||||||
|
|
||||||
|
use Chamilo\CoreBundle\Entity\User; |
||||||
|
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo; |
||||||
|
use Chamilo\CourseBundle\Entity\CCalendarEvent; |
||||||
|
use DateTime; |
||||||
|
use DateTimeZone; |
||||||
|
use Doctrine\DBAL\Schema\Schema; |
||||||
|
use Doctrine\ORM\Exception\ORMException; |
||||||
|
use Exception; |
||||||
|
|
||||||
|
class Version20231004220000 extends AbstractMigrationChamilo |
||||||
|
{ |
||||||
|
public function getDescription(): string |
||||||
|
{ |
||||||
|
return 'Drop fields not used in this version in table sys_announcement'; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* @inheritDoc |
||||||
|
* |
||||||
|
* @throws ORMException |
||||||
|
* @throws Exception |
||||||
|
*/ |
||||||
|
public function up(Schema $schema): void |
||||||
|
{ |
||||||
|
$table = $schema->getTable('sys_announcement'); |
||||||
|
if ($table->hasColumn('visible_teacher')) { |
||||||
|
$this->addSql('ALTER TABLE sys_announcement DROP visible_teacher'); |
||||||
|
} |
||||||
|
if ($table->hasColumn('visible_student')) { |
||||||
|
$this->addSql('ALTER TABLE sys_announcement DROP visible_student'); |
||||||
|
} |
||||||
|
if ($table->hasColumn('visible_guest')) { |
||||||
|
$this->addSql('ALTER TABLE sys_announcement DROP visible_guest'); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue