diff --git a/src/Bundle/ChillBudgetBundle/Migrations/Version20220223123742.php b/src/Bundle/ChillBudgetBundle/Migrations/Version20220223123742.php deleted file mode 100644 index 9aea60034..000000000 --- a/src/Bundle/ChillBudgetBundle/Migrations/Version20220223123742.php +++ /dev/null @@ -1,51 +0,0 @@ -addSql('DROP SEQUENCE chill_budget.charge_id_seq CASCADE'); - $this->addSql('DROP SEQUENCE chill_budget.resource_id_seq CASCADE'); - $this->addSql('DROP TABLE chill_budget.charge'); - $this->addSql('DROP TABLE chill_budget.resource'); - } - - public function getDescription(): string - { - return 'Creation of necessary tables for budget bundle'; - } - - public function up(Schema $schema): void - { - $this->addSql('CREATE SCHEMA chill_budget'); - $this->addSql('CREATE SEQUENCE chill_budget.charge_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE SEQUENCE chill_budget.resource_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE chill_budget.charge (id INT NOT NULL, person_id INT DEFAULT NULL, amount NUMERIC(10, 2) NOT NULL, comment TEXT DEFAULT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, type VARCHAR(255) NOT NULL, help VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_5C99D2C3217BBB47 ON chill_budget.charge (person_id)'); - $this->addSql('COMMENT ON COLUMN chill_budget.charge.endDate IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN chill_budget.charge.startDate IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('CREATE TABLE chill_budget.resource (id INT NOT NULL, person_id INT DEFAULT NULL, amount NUMERIC(10, 2) NOT NULL, comment TEXT DEFAULT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); - $this->addSql('CREATE INDEX IDX_5E0A5E97217BBB47 ON chill_budget.resource (person_id)'); - $this->addSql('COMMENT ON COLUMN chill_budget.resource.endDate IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('COMMENT ON COLUMN chill_budget.resource.startDate IS \'(DC2Type:datetime_immutable)\''); - $this->addSql('ALTER TABLE chill_budget.charge ADD CONSTRAINT FK_5C99D2C3217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - $this->addSql('ALTER TABLE chill_budget.resource ADD CONSTRAINT FK_5E0A5E97217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - } -} diff --git a/src/Bundle/ChillBudgetBundle/Migrations/Version20180522080432.php b/src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php similarity index 84% rename from src/Bundle/ChillBudgetBundle/Migrations/Version20180522080432.php rename to src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php index 022d53354..001506c0e 100644 --- a/src/Bundle/ChillBudgetBundle/Migrations/Version20180522080432.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace Application\Migrations; +namespace Chill\Migrations\Budget; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -21,9 +21,7 @@ final class Version20180522080432 extends AbstractMigration { public function down(Schema $schema): void { - // $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); - - $this->addSql('CREATE SCHEMA chill_budget CASCADE'); + $this->addSql('DROP SCHEMA chill_budget CASCADE'); } public function getDescription(): string @@ -33,10 +31,7 @@ final class Version20180522080432 extends AbstractMigration public function up(Schema $schema): void { - // $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); - $this->addSql('CREATE SCHEMA chill_budget'); - $this->addSql('DROP SEQUENCE report_id_seq CASCADE'); $this->addSql('CREATE SEQUENCE chill_budget.resource_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE chill_budget.charge_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE TABLE chill_budget.resource (id INT NOT NULL, person_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, amount NUMERIC(10, 2) NOT NULL, comment TEXT DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); diff --git a/src/Bundle/ChillBudgetBundle/Migrations/Version20181219145631.php b/src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php similarity index 66% rename from src/Bundle/ChillBudgetBundle/Migrations/Version20181219145631.php rename to src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php index 1de24772c..87ab85f90 100644 --- a/src/Bundle/ChillBudgetBundle/Migrations/Version20181219145631.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace Application\Migrations; +namespace Chill\Migrations\Budget; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -21,15 +21,11 @@ final class Version20181219145631 extends AbstractMigration { public function down(Schema $schema): void { - // $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); - $this->addSql('ALTER TABLE chill_budget.charge ALTER help SET NOT NULL'); } public function up(Schema $schema): void { - // $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); - $this->addSql('ALTER TABLE chill_budget.charge ALTER help DROP NOT NULL'); } } diff --git a/src/Bundle/ChillBudgetBundle/Migrations/Version20220224090319.php b/src/Bundle/ChillBudgetBundle/migrations/Version20220224090319.php similarity index 100% rename from src/Bundle/ChillBudgetBundle/Migrations/Version20220224090319.php rename to src/Bundle/ChillBudgetBundle/migrations/Version20220224090319.php