add ordoring field & Display Activity type by Category

This commit is contained in:
Jean-Francois Monfort
2021-05-06 11:53:07 +02:00
parent f836114d84
commit 1f1b9c594f
10 changed files with 134 additions and 17 deletions

View File

@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210506090417 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$this->addSql('ALTER TABLE activitytype ADD ordering DOUBLE PRECISION DEFAULT \'0.0\' NOT NULL');
$this->addSql('ALTER TABLE activitytypecategory ADD ordering DOUBLE PRECISION DEFAULT \'0.0\' NOT NULL');
}
public function down(Schema $schema) : void
{
$this->addSql('ALTER TABLE activitytypecategory DROP ordering');
$this->addSql('ALTER TABLE activitytype DROP ordering');
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210506094520 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
$this->addSql('ALTER TABLE activitytype ADD category_id INT DEFAULT 1');
$this->addSql('ALTER TABLE activitytype ADD CONSTRAINT FK_B38CD05112469DE2 FOREIGN KEY (category_id) REFERENCES activitytypecategory (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema) : void
{
$this->addSql('ALTER TABLE activitytype DROP CONSTRAINT FK_B38CD05112469DE2');;
$this->addSql('ALTER TABLE activitytype DROP category_id');
}
}