make somes changes on model: to manage isVisible field option + others

This commit is contained in:
2021-10-13 15:47:48 +02:00
parent 48f3c440a2
commit b418d13190
9 changed files with 102 additions and 30 deletions

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20211013124455 extends AbstractMigration
{
public function getDescription(): string
{
return 'add location visible admin option';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE activitytype ADD locationVisible SMALLINT DEFAULT 1 NOT NULL');
$this->addSql('ALTER TABLE activitytype ADD locationLabel VARCHAR(255) DEFAULT \'\' NOT NULL');
// fix old migration !?
$this->addSql('ALTER TABLE activitytype ALTER category_id DROP DEFAULT');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE activitytype DROP locationVisible');
$this->addSql('ALTER TABLE activitytype DROP locationLabel');
// fix old migration !?
$this->addSql('ALTER TABLE activitytype ALTER category_id SET DEFAULT 1');
}
}