adapt migrations files to flex

This commit is contained in:
Julien Fastré 2020-07-31 15:52:06 +02:00
parent bf3c9ead2d
commit 2ed1de8629
21 changed files with 56 additions and 56 deletions

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -10,7 +10,7 @@ use Doctrine\DBAL\Schema\Schema;
*/ */
class Version20141129010948 extends AbstractMigration class Version20141129010948 extends AbstractMigration
{ {
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->addSql("CREATE SEQUENCE ClosingMotive_id_seq INCREMENT BY 1 MINVALUE 1 START 1;"); $this->addSql("CREATE SEQUENCE ClosingMotive_id_seq INCREMENT BY 1 MINVALUE 1 START 1;");
$this->addSql("CREATE SEQUENCE person_history_file_id_seq INCREMENT BY 1 MINVALUE 1 START 1;"); $this->addSql("CREATE SEQUENCE person_history_file_id_seq INCREMENT BY 1 MINVALUE 1 START 1;");
@ -36,7 +36,7 @@ class Version20141129010948 extends AbstractMigration
} }
public function down(Schema $schema) public function down(Schema $schema): void
{ {
// this down() migration is auto-generated, please modify it to your needs // this down() migration is auto-generated, please modify it to your needs

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -10,7 +10,7 @@ use Doctrine\DBAL\Schema\Schema;
*/ */
class Version20150212173934 extends AbstractMigration class Version20150212173934 extends AbstractMigration
{ {
public function up(Schema $schema) public function up(Schema $schema): void
{ {
// this up() migration is auto-generated, please modify it to your needs // this up() migration is auto-generated, please modify it to your needs
@ -20,7 +20,7 @@ class Version20150212173934 extends AbstractMigration
} }
public function down(Schema $schema) public function down(Schema $schema): void
{ {
// this down() migration is auto-generated, please modify it to your needs // this down() migration is auto-generated, please modify it to your needs
$this->addSql("ALTER TABLE accompanying_period RENAME TO person_history_file;"); $this->addSql("ALTER TABLE accompanying_period RENAME TO person_history_file;");

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
@ -11,7 +11,7 @@ use Chill\MainBundle\Entity\Center;
*/ */
class Version20150607231010 extends AbstractMigration class Version20150607231010 extends AbstractMigration
{ {
public function getDescription() public function getDescription(): string
{ {
return 'Add a center on the person entity. The default center is the first ' return 'Add a center on the person entity. The default center is the first '
. 'recorded.'; . 'recorded.';
@ -21,7 +21,7 @@ class Version20150607231010 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',
@ -64,7 +64,7 @@ class Version20150607231010 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',

View File

@ -22,7 +22,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -37,7 +37,7 @@ class Version20150811152608 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',
@ -53,7 +53,7 @@ class Version20150811152608 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',

View File

@ -22,7 +22,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -33,7 +33,7 @@ class Version20150812110708 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',
@ -50,7 +50,7 @@ class Version20150812110708 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',

View File

@ -22,7 +22,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -34,7 +34,7 @@ class Version20150820113409 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',
@ -48,7 +48,7 @@ class Version20150820113409 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() != 'postgresql',

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -13,7 +13,7 @@ class Version20160310161006 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
// this up() migration is auto-generated, please modify it to your needs // this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
@ -39,7 +39,7 @@ class Version20160310161006 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -13,7 +13,7 @@ class Version20160422000000 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$stmt = $this->connection->query('SELECT COUNT(*), pe.id, ad.validfrom FROM person AS pe $stmt = $this->connection->query('SELECT COUNT(*), pe.id, ad.validfrom FROM person AS pe
INNER JOIN chill_person_persons_to_addresses AS pe_ad ON pe.id = pe_ad.person_id INNER JOIN chill_person_persons_to_addresses AS pe_ad ON pe.id = pe_ad.person_id
@ -36,7 +36,7 @@ class Version20160422000000 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
} }
} }

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -17,7 +17,7 @@ class Version20160818113633 extends AbstractMigration
* *
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$personIdAndCFData = $this->connection->executeQuery('SELECT id, cfdata FROM person'); $personIdAndCFData = $this->connection->executeQuery('SELECT id, cfdata FROM person');
@ -41,7 +41,7 @@ class Version20160818113633 extends AbstractMigration
* *
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->addSQL('ALTER TABLE person DROP COLUMN cfdata'); $this->addSQL('ALTER TABLE person DROP COLUMN cfdata');
$this->addSQL('ALTER TABLE person RENAME COLUMN cfdata_old TO cfdata'); $this->addSQL('ALTER TABLE person RENAME COLUMN cfdata_old TO cfdata');

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -13,7 +13,7 @@ class Version20160818151130 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->addSql('ALTER TABLE person RENAME TO chill_person_person'); $this->addSql('ALTER TABLE person RENAME TO chill_person_person');
$this->addSql('ALTER TABLE person_id_seq RENAME TO chill_person_person_id_seq'); $this->addSql('ALTER TABLE person_id_seq RENAME TO chill_person_person_id_seq');
@ -30,7 +30,7 @@ class Version20160818151130 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
$this->addSQL('ALTER TABLE chill_person_person RENAME TO person'); $this->addSQL('ALTER TABLE chill_person_person RENAME TO person');
$this->addSql('ALTER TABLE chill_person_person_id_seq RENAME TO person_id_seq'); $this->addSql('ALTER TABLE chill_person_person_id_seq RENAME TO person_id_seq');

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**
@ -27,7 +27,7 @@ class Version20170117131924 extends AbstractMigration
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function up(Schema $schema) public function up(Schema $schema): void
{ {
$this->addSql(<<<'SQL' $this->addSql(<<<'SQL'
CREATE OR REPLACE FUNCTION public.get_last_address ( CREATE OR REPLACE FUNCTION public.get_last_address (
@ -99,7 +99,7 @@ SQL
/** /**
* @param Schema $schema * @param Schema $schema
*/ */
public function down(Schema $schema) public function down(Schema $schema): void
{ {
// drop function to get parts of address // drop function to get parts of address
foreach ($this->fields as $var => $type) { foreach ($this->fields as $var => $type) {

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**

View File

@ -2,7 +2,7 @@
namespace Application\Migrations; namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration; use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
/** /**