not working
This commit is contained in:
parent
a8404a33bd
commit
937c2a459d
|
@ -1,31 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220520203412 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE entity1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE entity1');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220522111615 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
$this->addSql('CREATE TABLE toothbrush1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, brand VARCHAR(255) NOT NULL)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('DROP TABLE toothbrush1');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220522115037 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE person2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush2_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL, job VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_A387B6D5189073D6 ON person2 (toothbrush2_id)');
|
|
||||||
$this->addSql('CREATE TABLE toothbrush2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, brand VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('DROP INDEX UNIQ_2250E3BCA25DC38');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee1 AS SELECT id, toothbrush1_id, job, age, name FROM employee1');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, CONSTRAINT FK_2250E3BCA25DC38 FOREIGN KEY (toothbrush1_id) REFERENCES toothbrush1 (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO employee1 (id, toothbrush1_id, job, age, name) SELECT id, toothbrush1_id, job, age, name FROM __temp__employee1');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee1');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE person2');
|
|
||||||
$this->addSql('DROP TABLE toothbrush2');
|
|
||||||
$this->addSql('DROP INDEX UNIQ_2250E3BCA25DC38');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee1 AS SELECT id, toothbrush1_id, job, age, name FROM employee1');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('INSERT INTO employee1 (id, toothbrush1_id, job, age, name) SELECT id, toothbrush1_id, job, age, name FROM __temp__employee1');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee1');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220522153147 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE employee3 (id INTEGER NOT NULL, job VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
|
||||||
$this->addSql('CREATE TABLE person3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush3_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_D4808643A02C14B3 ON person3 (toothbrush3_id)');
|
|
||||||
$this->addSql('CREATE TABLE toothbrush3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, brand VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('DROP INDEX UNIQ_2250E3BCA25DC38');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee1 AS SELECT id, toothbrush1_id, job, age, name FROM employee1');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, CONSTRAINT FK_2250E3BCA25DC38 FOREIGN KEY (toothbrush1_id) REFERENCES toothbrush1 (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO employee1 (id, toothbrush1_id, job, age, name) SELECT id, toothbrush1_id, job, age, name FROM __temp__employee1');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee1');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
$this->addSql('DROP INDEX IDX_A387B6D5189073D6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__person2 AS SELECT id, toothbrush2_id, age, name, discr, job FROM person2');
|
|
||||||
$this->addSql('DROP TABLE person2');
|
|
||||||
$this->addSql('CREATE TABLE person2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush2_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL, job VARCHAR(255) DEFAULT NULL, CONSTRAINT FK_A387B6D5189073D6 FOREIGN KEY (toothbrush2_id) REFERENCES toothbrush2 (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO person2 (id, toothbrush2_id, age, name, discr, job) SELECT id, toothbrush2_id, age, name, discr, job FROM __temp__person2');
|
|
||||||
$this->addSql('DROP TABLE __temp__person2');
|
|
||||||
$this->addSql('CREATE INDEX IDX_A387B6D5189073D6 ON person2 (toothbrush2_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE employee3');
|
|
||||||
$this->addSql('DROP TABLE person3');
|
|
||||||
$this->addSql('DROP TABLE toothbrush3');
|
|
||||||
$this->addSql('DROP INDEX UNIQ_2250E3BCA25DC38');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee1 AS SELECT id, toothbrush1_id, job, age, name FROM employee1');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('INSERT INTO employee1 (id, toothbrush1_id, job, age, name) SELECT id, toothbrush1_id, job, age, name FROM __temp__employee1');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee1');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
$this->addSql('DROP INDEX IDX_A387B6D5189073D6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__person2 AS SELECT id, toothbrush2_id, age, name, discr, job FROM person2');
|
|
||||||
$this->addSql('DROP TABLE person2');
|
|
||||||
$this->addSql('CREATE TABLE person2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush2_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL, job VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('INSERT INTO person2 (id, toothbrush2_id, age, name, discr, job) SELECT id, toothbrush2_id, age, name, discr, job FROM __temp__person2');
|
|
||||||
$this->addSql('DROP TABLE __temp__person2');
|
|
||||||
$this->addSql('CREATE INDEX IDX_A387B6D5189073D6 ON person2 (toothbrush2_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,81 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220522154942 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX UNIQ_2250E3BCA25DC38');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee1 AS SELECT id, toothbrush1_id, job, age, name FROM employee1');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, CONSTRAINT FK_2250E3BCA25DC38 FOREIGN KEY (toothbrush1_id) REFERENCES toothbrush1 (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO employee1 (id, toothbrush1_id, job, age, name) SELECT id, toothbrush1_id, job, age, name FROM __temp__employee1');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee1');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee3 AS SELECT id, job FROM employee3');
|
|
||||||
$this->addSql('DROP TABLE employee3');
|
|
||||||
$this->addSql('CREATE TABLE employee3 (id INTEGER NOT NULL, job VARCHAR(255) NOT NULL, PRIMARY KEY(id), CONSTRAINT FK_CC5E8290BF396750 FOREIGN KEY (id) REFERENCES person3 (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO employee3 (id, job) SELECT id, job FROM __temp__employee3');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee3');
|
|
||||||
$this->addSql('DROP INDEX IDX_A387B6D5189073D6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__person2 AS SELECT id, toothbrush2_id, age, name, discr, job FROM person2');
|
|
||||||
$this->addSql('DROP TABLE person2');
|
|
||||||
$this->addSql('CREATE TABLE person2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush2_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL, job VARCHAR(255) DEFAULT NULL, CONSTRAINT FK_A387B6D5189073D6 FOREIGN KEY (toothbrush2_id) REFERENCES toothbrush2 (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO person2 (id, toothbrush2_id, age, name, discr, job) SELECT id, toothbrush2_id, age, name, discr, job FROM __temp__person2');
|
|
||||||
$this->addSql('DROP TABLE __temp__person2');
|
|
||||||
$this->addSql('CREATE INDEX IDX_A387B6D5189073D6 ON person2 (toothbrush2_id)');
|
|
||||||
$this->addSql('DROP INDEX UNIQ_D4808643A02C14B3');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__person3 AS SELECT id, toothbrush3_id, age, name, discr FROM person3');
|
|
||||||
$this->addSql('DROP TABLE person3');
|
|
||||||
$this->addSql('CREATE TABLE person3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush3_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL, CONSTRAINT FK_D4808643A02C14B3 FOREIGN KEY (toothbrush3_id) REFERENCES toothbrush3 (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO person3 (id, toothbrush3_id, age, name, discr) SELECT id, toothbrush3_id, age, name, discr FROM __temp__person3');
|
|
||||||
$this->addSql('DROP TABLE __temp__person3');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_D4808643A02C14B3 ON person3 (toothbrush3_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX UNIQ_2250E3BCA25DC38');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee1 AS SELECT id, toothbrush1_id, job, age, name FROM employee1');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('INSERT INTO employee1 (id, toothbrush1_id, job, age, name) SELECT id, toothbrush1_id, job, age, name FROM __temp__employee1');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee1');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__employee3 AS SELECT id, job FROM employee3');
|
|
||||||
$this->addSql('DROP TABLE employee3');
|
|
||||||
$this->addSql('CREATE TABLE employee3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, job VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('INSERT INTO employee3 (id, job) SELECT id, job FROM __temp__employee3');
|
|
||||||
$this->addSql('DROP TABLE __temp__employee3');
|
|
||||||
$this->addSql('DROP INDEX IDX_A387B6D5189073D6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__person2 AS SELECT id, toothbrush2_id, age, name, discr, job FROM person2');
|
|
||||||
$this->addSql('DROP TABLE person2');
|
|
||||||
$this->addSql('CREATE TABLE person2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush2_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL, job VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('INSERT INTO person2 (id, toothbrush2_id, age, name, discr, job) SELECT id, toothbrush2_id, age, name, discr, job FROM __temp__person2');
|
|
||||||
$this->addSql('DROP TABLE __temp__person2');
|
|
||||||
$this->addSql('CREATE INDEX IDX_A387B6D5189073D6 ON person2 (toothbrush2_id)');
|
|
||||||
$this->addSql('DROP INDEX UNIQ_D4808643A02C14B3');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__person3 AS SELECT id, toothbrush3_id, age, name, discr FROM person3');
|
|
||||||
$this->addSql('DROP TABLE person3');
|
|
||||||
$this->addSql('CREATE TABLE person3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush3_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL, discr VARCHAR(255) NOT NULL)');
|
|
||||||
$this->addSql('INSERT INTO person3 (id, toothbrush3_id, age, name, discr) SELECT id, toothbrush3_id, age, name, discr FROM __temp__person3');
|
|
||||||
$this->addSql('DROP TABLE __temp__person3');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_D4808643A02C14B3 ON person3 (toothbrush3_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523093709 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Mer* simulation and cleanup';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE mer_service (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, mcc_mnc INTEGER DEFAULT NULL, metadata CLOB DEFAULT NULL --(DC2Type:json)
|
|
||||||
, discr VARCHAR(255) NOT NULL, product_code VARCHAR(255) DEFAULT NULL, offer_id INTEGER DEFAULT NULL, api_key VARCHAR(255) DEFAULT NULL, service_id VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('DROP TABLE employee1');
|
|
||||||
$this->addSql('DROP TABLE employee3');
|
|
||||||
$this->addSql('DROP TABLE person2');
|
|
||||||
$this->addSql('DROP TABLE person3');
|
|
||||||
$this->addSql('DROP TABLE toothbrush1');
|
|
||||||
$this->addSql('DROP TABLE toothbrush2');
|
|
||||||
$this->addSql('DROP TABLE toothbrush3');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE employee1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush1_id INTEGER DEFAULT NULL, job VARCHAR(255) NOT NULL COLLATE BINARY, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2250E3BCA25DC38 ON employee1 (toothbrush1_id)');
|
|
||||||
$this->addSql('CREATE TABLE employee3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, job VARCHAR(255) NOT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('CREATE TABLE person2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush2_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL COLLATE BINARY, discr VARCHAR(255) NOT NULL COLLATE BINARY, job VARCHAR(255) DEFAULT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_A387B6D5189073D6 ON person2 (toothbrush2_id)');
|
|
||||||
$this->addSql('CREATE TABLE person3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, toothbrush3_id INTEGER DEFAULT NULL, age INTEGER NOT NULL, name VARCHAR(255) NOT NULL COLLATE BINARY, discr VARCHAR(255) NOT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_D4808643A02C14B3 ON person3 (toothbrush3_id)');
|
|
||||||
$this->addSql('CREATE TABLE toothbrush1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, brand VARCHAR(255) NOT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('CREATE TABLE toothbrush2 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, brand VARCHAR(255) NOT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('CREATE TABLE toothbrush3 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, brand VARCHAR(255) NOT NULL COLLATE BINARY)');
|
|
||||||
$this->addSql('DROP TABLE mer_service');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523110817 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'Be* added';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('ALTER TABLE mer_service ADD COLUMN activation_code VARCHAR(255) DEFAULT NULL');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_service AS SELECT id, mcc_mnc, metadata, discr, product_code, offer_id, api_key, service_id FROM mer_service');
|
|
||||||
$this->addSql('DROP TABLE mer_service');
|
|
||||||
$this->addSql('CREATE TABLE mer_service (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, mcc_mnc INTEGER DEFAULT NULL, metadata CLOB DEFAULT NULL --(DC2Type:json)
|
|
||||||
, discr VARCHAR(255) NOT NULL, product_code VARCHAR(255) DEFAULT NULL, offer_id INTEGER DEFAULT NULL, api_key VARCHAR(255) DEFAULT NULL, service_id VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('INSERT INTO mer_service (id, mcc_mnc, metadata, discr, product_code, offer_id, api_key, service_id) SELECT id, mcc_mnc, metadata, discr, product_code, offer_id, api_key, service_id FROM __temp__mer_service');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_service');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523114408 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, red_code VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523132530 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// MODIFICATION NEEDED: added DATETIME() to INSERTS to prevent:
|
|
||||||
// SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint failed: mer_para_sub.sub_date
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, red_code FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, red_code VARCHAR(255) DEFAULT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, red_code, sub_date) SELECT id, service_id, red_code, DATETIME() FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, red_code FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, red_code VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, red_code) SELECT id, service_id, red_code FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523152033 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, sub_date, unsub_date FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, pin INTEGER DEFAULT NULL, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, sub_date, unsub_date) SELECT id, service_id, sub_date, unsub_date FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, sub_date, unsub_date FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, red_code VARCHAR(255) DEFAULT NULL)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, sub_date, unsub_date) SELECT id, service_id, sub_date, unsub_date FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523155141 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Added 'status' to INSERT
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, sub_date, unsub_date, pin FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, sub_date, unsub_date, pin, status) SELECT id, service_id, sub_date, unsub_date, pin, 1 FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, pin, sub_date, unsub_date FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, pin INTEGER DEFAULT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, pin, sub_date, unsub_date) SELECT id, service_id, pin, sub_date, unsub_date FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace DoctrineMigrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20220523155631 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this up() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('CREATE TABLE mer_be_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, code VARCHAR(255) DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
)');
|
|
||||||
$this->addSql('CREATE INDEX IDX_CA4C3EB8ED5CA9E6 ON mer_be_sub (service_id)');
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, sub_date, unsub_date, pin, status FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, sub_date, unsub_date, pin, status) SELECT id, service_id, sub_date, unsub_date, pin, status FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
// this down() migration is auto-generated, please modify it to your needs
|
|
||||||
$this->addSql('DROP TABLE mer_be_sub');
|
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, pin, status, sub_date, unsub_date FROM mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
|
||||||
)');
|
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, pin, status, sub_date, unsub_date) SELECT id, service_id, pin, status, sub_date, unsub_date FROM __temp__mer_para_sub');
|
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20220524145056 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE TABLE entity1 (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name VARCHAR(255) NOT NULL)');
|
||||||
|
$this->addSql('CREATE TABLE mer_be_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, code VARCHAR(255) DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
||||||
|
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
||||||
|
)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_CA4C3EB8ED5CA9E6 ON mer_be_sub (service_id)');
|
||||||
|
$this->addSql('CREATE TABLE mer_dm (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, offer_id INTEGER NOT NULL)');
|
||||||
|
$this->addSql('CREATE TABLE mer_dt (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id VARCHAR(255) NOT NULL)');
|
||||||
|
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
||||||
|
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
||||||
|
)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
||||||
|
$this->addSql('CREATE TABLE mer_service (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, platform_id INTEGER NOT NULL, mcc_mnc INTEGER DEFAULT NULL, metadata CLOB DEFAULT NULL --(DC2Type:json)
|
||||||
|
, discr VARCHAR(255) NOT NULL, product_code VARCHAR(255) DEFAULT NULL, api_key VARCHAR(255) DEFAULT NULL, activation_code VARCHAR(255) DEFAULT NULL)');
|
||||||
|
$this->addSql('CREATE INDEX IDX_E9ABEA72FFE6496F ON mer_service (platform_id)');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('DROP TABLE entity1');
|
||||||
|
$this->addSql('DROP TABLE mer_be_sub');
|
||||||
|
$this->addSql('DROP TABLE mer_dm');
|
||||||
|
$this->addSql('DROP TABLE mer_dt');
|
||||||
|
$this->addSql('DROP TABLE mer_para_sub');
|
||||||
|
$this->addSql('DROP TABLE mer_service');
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,7 +10,7 @@ use Doctrine\Migrations\AbstractMigration;
|
||||||
/**
|
/**
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
*/
|
*/
|
||||||
final class Version20220524080445 extends AbstractMigration
|
final class Version20220524145844 extends AbstractMigration
|
||||||
{
|
{
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
{
|
{
|
||||||
|
@ -30,12 +30,12 @@ final class Version20220524080445 extends AbstractMigration
|
||||||
$this->addSql('DROP TABLE __temp__mer_be_sub');
|
$this->addSql('DROP TABLE __temp__mer_be_sub');
|
||||||
$this->addSql('CREATE INDEX IDX_CA4C3EB8ED5CA9E6 ON mer_be_sub (service_id)');
|
$this->addSql('CREATE INDEX IDX_CA4C3EB8ED5CA9E6 ON mer_be_sub (service_id)');
|
||||||
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
$this->addSql('DROP INDEX IDX_E4F82A3DED5CA9E6');
|
||||||
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, sub_date, unsub_date, pin, status FROM mer_para_sub');
|
$this->addSql('CREATE TEMPORARY TABLE __temp__mer_para_sub AS SELECT id, service_id, pin, status, sub_date, unsub_date FROM mer_para_sub');
|
||||||
$this->addSql('DROP TABLE mer_para_sub');
|
$this->addSql('DROP TABLE mer_para_sub');
|
||||||
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
$this->addSql('CREATE TABLE mer_para_sub (id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, service_id INTEGER NOT NULL, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, sub_date DATETIME NOT NULL --(DC2Type:datetime_immutable)
|
||||||
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
, unsub_date DATETIME DEFAULT NULL --(DC2Type:datetime_immutable)
|
||||||
, pin INTEGER DEFAULT NULL, status INTEGER NOT NULL, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
, CONSTRAINT FK_E4F82A3DED5CA9E6 FOREIGN KEY (service_id) REFERENCES mer_service (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
|
||||||
$this->addSql('INSERT INTO mer_para_sub (id, service_id, sub_date, unsub_date, pin, status) SELECT id, service_id, sub_date, unsub_date, pin, status FROM __temp__mer_para_sub');
|
$this->addSql('INSERT INTO mer_para_sub (id, service_id, pin, status, sub_date, unsub_date) SELECT id, service_id, pin, status, sub_date, unsub_date FROM __temp__mer_para_sub');
|
||||||
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
$this->addSql('DROP TABLE __temp__mer_para_sub');
|
||||||
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
$this->addSql('CREATE INDEX IDX_E4F82A3DED5CA9E6 ON mer_para_sub (service_id)');
|
||||||
}
|
}
|
|
@ -4,6 +4,8 @@ namespace App\DataFixtures;
|
||||||
|
|
||||||
use App\Entity\MerBeDM;
|
use App\Entity\MerBeDM;
|
||||||
use App\Entity\MerBeSub;
|
use App\Entity\MerBeSub;
|
||||||
|
use App\Entity\MerDM;
|
||||||
|
use App\Entity\MerDT;
|
||||||
use App\Entity\MerParaDM;
|
use App\Entity\MerParaDM;
|
||||||
use App\Entity\MerParaDT;
|
use App\Entity\MerParaDT;
|
||||||
use App\Entity\MerParaSub;
|
use App\Entity\MerParaSub;
|
||||||
|
@ -17,27 +19,27 @@ class MerFixtures extends Fixture
|
||||||
{
|
{
|
||||||
$ser1 = new MerParaDM();
|
$ser1 = new MerParaDM();
|
||||||
$ser1->setMccMnc(12345)
|
$ser1->setMccMnc(12345)
|
||||||
->setOfferId(221)
|
->setPlatform((new MerDM())->setOfferId(221))
|
||||||
->setProductCode('code1');
|
->setProductCode('code1');
|
||||||
|
|
||||||
$ser2 = new MerParaDM();
|
$ser2 = new MerParaDM();
|
||||||
$ser2->setMccMnc(12345)
|
$ser2->setMccMnc(12345)
|
||||||
->setOfferId(223)
|
->setPlatform((new MerDM())->setOfferId(223))
|
||||||
->setProductCode('code2');
|
->setProductCode('code2');
|
||||||
|
|
||||||
$ser3 = new MerParaDT();
|
$ser3 = new MerParaDT();
|
||||||
$ser3->setMccMnc(12345)
|
$ser3->setMccMnc(12345)
|
||||||
->setServiceId('ser-vi-ce1')
|
->setPlatform((new MerDT())->setServiceId('ser-vi-ce1'))
|
||||||
->setApiKey('api1');
|
->setApiKey('api1');
|
||||||
|
|
||||||
$ser4 = new MerParaDT();
|
$ser4 = new MerParaDT();
|
||||||
$ser4->setMccMnc(12341)
|
$ser4->setMccMnc(12341)
|
||||||
->setServiceId('ser-vi-ce2')
|
->setPlatform((new MerDT())->setServiceId('ser-vi-ce2'))
|
||||||
->setApiKey('api2');
|
->setApiKey('api2');
|
||||||
|
|
||||||
$ser5 = new MerBeDM();
|
$ser5 = new MerBeDM();
|
||||||
$ser5->setMccMnc(12341)
|
$ser5->setMccMnc(12341)
|
||||||
->setOfferId(112)
|
->setPlatform((new MerDM())->setOfferId(112))
|
||||||
->setActivationCode('active1');
|
->setActivationCode('active1');
|
||||||
|
|
||||||
$sub1 = new MerParaSub();
|
$sub1 = new MerParaSub();
|
||||||
|
|
|
@ -8,8 +8,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||||
#[ORM\Entity(repositoryClass: MerBeDMRepository::class)]
|
#[ORM\Entity(repositoryClass: MerBeDMRepository::class)]
|
||||||
class MerBeDM extends MerService
|
class MerBeDM extends MerService
|
||||||
{
|
{
|
||||||
use MerDM;
|
|
||||||
|
|
||||||
// #[ORM\Id]
|
// #[ORM\Id]
|
||||||
// #[ORM\GeneratedValue]
|
// #[ORM\GeneratedValue]
|
||||||
// #[ORM\Column(type: 'integer')]
|
// #[ORM\Column(type: 'integer')]
|
||||||
|
@ -18,6 +16,10 @@ class MerBeDM extends MerService
|
||||||
#[ORM\Column(type: 'string', length: 255)]
|
#[ORM\Column(type: 'string', length: 255)]
|
||||||
private $activation_code;
|
private $activation_code;
|
||||||
|
|
||||||
|
#[ORM\OneToOne(targetEntity: MerDM::class, cascade: ['persist'])]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private MerDM $platform;
|
||||||
|
|
||||||
// public function getId(): ?int
|
// public function getId(): ?int
|
||||||
// {
|
// {
|
||||||
// return $this->id;
|
// return $this->id;
|
||||||
|
@ -34,4 +36,16 @@ class MerBeDM extends MerService
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPlatform(): ?MerDM
|
||||||
|
{
|
||||||
|
return $this->platform;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPlatform(?MerDM $platform): self
|
||||||
|
{
|
||||||
|
$this->platform = $platform;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,21 +5,21 @@ namespace App\Entity;
|
||||||
use App\Repository\MerDMRepository;
|
use App\Repository\MerDMRepository;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
//#[ORM\Entity(repositoryClass: MerDMRepository::class)]
|
#[ORM\Entity(repositoryClass: MerDMRepository::class)]
|
||||||
trait MerDM
|
class MerDM
|
||||||
{
|
{
|
||||||
// #[ORM\Id]
|
#[ORM\Id]
|
||||||
// #[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
||||||
// #[ORM\Column(type: 'integer')]
|
#[ORM\Column(type: 'integer')]
|
||||||
// private $id;
|
private $id;
|
||||||
|
|
||||||
#[ORM\Column(type: 'integer')]
|
#[ORM\Column(type: 'integer')]
|
||||||
private $offer_id;
|
private $offer_id;
|
||||||
|
|
||||||
// public function getId(): ?int
|
public function getId(): ?int
|
||||||
// {
|
{
|
||||||
// return $this->id;
|
return $this->id;
|
||||||
// }
|
}
|
||||||
|
|
||||||
public function getOfferId(): ?int
|
public function getOfferId(): ?int
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,21 +5,21 @@ namespace App\Entity;
|
||||||
use App\Repository\MerDTRepository;
|
use App\Repository\MerDTRepository;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
//#[ORM\Entity(repositoryClass: MerDTRepository::class)]
|
#[ORM\Entity(repositoryClass: MerDTRepository::class)]
|
||||||
trait MerDT
|
class MerDT
|
||||||
{
|
{
|
||||||
// #[ORM\Id]
|
#[ORM\Id]
|
||||||
// #[ORM\GeneratedValue]
|
#[ORM\GeneratedValue]
|
||||||
// #[ORM\Column(type: 'integer')]
|
#[ORM\Column(type: 'integer')]
|
||||||
// private $id;
|
private $id;
|
||||||
|
|
||||||
#[ORM\Column(type: 'string', length: 255)]
|
#[ORM\Column(type: 'string', length: 255)]
|
||||||
private $service_id;
|
private $service_id;
|
||||||
|
|
||||||
// public function getId(): ?int
|
public function getId(): ?int
|
||||||
// {
|
{
|
||||||
// return $this->id;
|
return $this->id;
|
||||||
// }
|
}
|
||||||
|
|
||||||
public function getServiceId(): ?string
|
public function getServiceId(): ?string
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,8 +8,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||||
#[ORM\Entity(repositoryClass: MerParaDMRepository::class)]
|
#[ORM\Entity(repositoryClass: MerParaDMRepository::class)]
|
||||||
class MerParaDM extends MerService
|
class MerParaDM extends MerService
|
||||||
{
|
{
|
||||||
use MerDM;
|
|
||||||
|
|
||||||
// #[ORM\Id]
|
// #[ORM\Id]
|
||||||
// #[ORM\GeneratedValue]
|
// #[ORM\GeneratedValue]
|
||||||
// #[ORM\Column(type: 'integer')]
|
// #[ORM\Column(type: 'integer')]
|
||||||
|
@ -18,6 +16,10 @@ class MerParaDM extends MerService
|
||||||
#[ORM\Column(type: 'string', length: 255)]
|
#[ORM\Column(type: 'string', length: 255)]
|
||||||
private $product_code;
|
private $product_code;
|
||||||
|
|
||||||
|
#[ORM\OneToOne(targetEntity: MerDM::class, cascade: ['persist'])]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private MerDM $platform;
|
||||||
|
|
||||||
// public function getId(): ?int
|
// public function getId(): ?int
|
||||||
// {
|
// {
|
||||||
// return $this->id;
|
// return $this->id;
|
||||||
|
@ -34,4 +36,16 @@ class MerParaDM extends MerService
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPlatform(): ?MerDM
|
||||||
|
{
|
||||||
|
return $this->platform;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPlatform(?MerDM $platform): self
|
||||||
|
{
|
||||||
|
$this->platform = $platform;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,6 @@ use Doctrine\ORM\Mapping as ORM;
|
||||||
#[ORM\Entity(repositoryClass: MerParaDTRepository::class)]
|
#[ORM\Entity(repositoryClass: MerParaDTRepository::class)]
|
||||||
class MerParaDT extends MerService
|
class MerParaDT extends MerService
|
||||||
{
|
{
|
||||||
use MerDT;
|
|
||||||
|
|
||||||
// #[ORM\Id]
|
// #[ORM\Id]
|
||||||
// #[ORM\GeneratedValue]
|
// #[ORM\GeneratedValue]
|
||||||
// #[ORM\Column(type: 'integer')]
|
// #[ORM\Column(type: 'integer')]
|
||||||
|
@ -18,6 +16,10 @@ class MerParaDT extends MerService
|
||||||
#[ORM\Column(type: 'string', length: 255)]
|
#[ORM\Column(type: 'string', length: 255)]
|
||||||
private $api_key;
|
private $api_key;
|
||||||
|
|
||||||
|
#[ORM\OneToOne(targetEntity: MerDT::class, cascade: ['persist'])]
|
||||||
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
|
private MerDT $platform;
|
||||||
|
|
||||||
// public function getId(): ?int
|
// public function getId(): ?int
|
||||||
// {
|
// {
|
||||||
// return $this->id;
|
// return $this->id;
|
||||||
|
@ -34,4 +36,16 @@ class MerParaDT extends MerService
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPlatform(): ?MerDT
|
||||||
|
{
|
||||||
|
return $this->platform;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPlatform(?MerDT $platform): self
|
||||||
|
{
|
||||||
|
$this->platform = $platform;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,22 +80,30 @@ class MerServiceRepository extends ServiceEntityRepository
|
||||||
// ->getResult()
|
// ->getResult()
|
||||||
// ;
|
// ;
|
||||||
|
|
||||||
$rsm = new ResultSetMapping();
|
// $rsm = new ResultSetMapping();
|
||||||
$rsm->addEntityResult($this->getClassName(), 's');
|
// $rsm->addEntityResult($this->getClassName(), 's');
|
||||||
$rsm->addFieldResult('s', 'id', 'id');
|
// $rsm->addFieldResult('s', 'id', 'id');
|
||||||
$rsm->addMetaResult('s', 'discr', 'discr');
|
// $rsm->addMetaResult('s', 'discr', 'discr');
|
||||||
$rsm->setDiscriminatorColumn('s', 'discr');
|
// $rsm->setDiscriminatorColumn('s', 'discr');
|
||||||
|
//
|
||||||
|
// $query = $this->getEntityManager()
|
||||||
|
// ->createNativeQuery('SELECT m.id, m.discr FROM mer_service m WHERE offer_id = :offer_id', $rsm);
|
||||||
|
// $query->setParameter('offer_id', $offerId);
|
||||||
|
//
|
||||||
|
// $res = $query->getResult();
|
||||||
|
//
|
||||||
|
// foreach ($res as $k => $obj) {
|
||||||
|
// $this->getEntityManager()->refresh($obj);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return $res;
|
||||||
|
|
||||||
$query = $this->getEntityManager()
|
return $this->createQueryBuilder('s')
|
||||||
->createNativeQuery('SELECT m.id, m.discr FROM mer_service m WHERE offer_id = :offer_id', $rsm);
|
->leftJoin('s.platform_id', 'p')
|
||||||
$query->setParameter('offer_id', $offerId);
|
->andWhere('p.offer_id = :offer_id')
|
||||||
|
->setParameter('offer_id', $offerId)
|
||||||
$res = $query->getResult();
|
->getQuery()
|
||||||
|
->getResult()
|
||||||
foreach ($res as $k => $obj) {
|
;
|
||||||
$this->getEntityManager()->refresh($obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $res;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue