mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-04 22:04:59 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Person;
|
||||
@@ -8,10 +15,19 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add position to househould_member
|
||||
* Add position to househould_member.
|
||||
*/
|
||||
final class Version20210528111624 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_household_members DROP CONSTRAINT FK_EEF5DED7DD842E46');
|
||||
$this->addSql('DROP SEQUENCE chill_person_household_position_id_seq CASCADE');
|
||||
$this->addSql('DROP TABLE chill_person_household_position');
|
||||
$this->addSql('ALTER TABLE chill_person_household_members ADD "position" VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_household_members DROP position_id');
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add position to househould_member';
|
||||
@@ -21,19 +37,10 @@ final class Version20210528111624 extends AbstractMigration
|
||||
{
|
||||
$this->addSql('CREATE SEQUENCE chill_person_household_position_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE TABLE chill_person_household_position (id INT NOT NULL, label JSON NOT NULL, shareHouseHold BOOLEAN NOT NULL, allowHolder BOOLEAN NOT NULL, ordering DOUBLE PRECISION NOT NULL, PRIMARY KEY(id))');
|
||||
|
||||
|
||||
$this->addSql('ALTER TABLE chill_person_household_members ADD position_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_household_members DROP "position"');
|
||||
$this->addSql('ALTER TABLE chill_person_household_members ADD CONSTRAINT FK_EEF5DED7DD842E46 FOREIGN KEY (position_id) REFERENCES chill_person_household_position (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_EEF5DED7DD842E46 ON chill_person_household_members (position_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_household_members DROP CONSTRAINT FK_EEF5DED7DD842E46');
|
||||
$this->addSql('DROP SEQUENCE chill_person_household_position_id_seq CASCADE');
|
||||
$this->addSql('DROP TABLE chill_person_household_position');
|
||||
$this->addSql('ALTER TABLE chill_person_household_members ADD "position" VARCHAR(255) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_household_members DROP position_id');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user