Skip to content

Commit ba937ad

Browse files
committed
Revert regenerating migrations in 1.0
1 parent e378c18 commit ba937ad

16 files changed

+656
-82
lines changed

src/Migrations/Version20180625120743.php

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20180626120743 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
// this up() migration is auto-generated, please modify it to your needs
24+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
25+
26+
$this->addSql('CREATE TABLE sylius_invoicing_plugin_invoice (id VARCHAR(255) NOT NULL, billing_data_id INT DEFAULT NULL, order_number VARCHAR(255) NOT NULL, issued_at DATETIME NOT NULL, currency_code VARCHAR(3) NOT NULL, tax_total INT NOT NULL, total INT NOT NULL, UNIQUE INDEX UNIQ_3AA279BF5CDB2AEB (billing_data_id), INDEX IDX_3AA279BF551F0F81 (order_number), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB');
27+
$this->addSql('CREATE TABLE sylius_invoicing_plugin_line_item (id INT AUTO_INCREMENT NOT NULL, invoice_id VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, quantity INT NOT NULL, unit_price INT NOT NULL, subtotal INT NOT NULL, tax_total INT NOT NULL, total INT NOT NULL, variant_code VARCHAR(255) DEFAULT NULL, variant_name VARCHAR(255) DEFAULT NULL, INDEX IDX_C91408292989F1FD (invoice_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB');
28+
$this->addSql('CREATE TABLE sylius_invoicing_plugin_billing_data (id INT AUTO_INCREMENT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, company VARCHAR(255) DEFAULT NULL, street VARCHAR(255) NOT NULL, city VARCHAR(255) NOT NULL, postcode VARCHAR(255) NOT NULL, country_code VARCHAR(255) NOT NULL, province_code VARCHAR(255) DEFAULT NULL, province_name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB');
29+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD CONSTRAINT FK_3AA279BF5CDB2AEB FOREIGN KEY (billing_data_id) REFERENCES sylius_invoicing_plugin_billing_data (id)');
30+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_line_item ADD CONSTRAINT FK_C91408292989F1FD FOREIGN KEY (invoice_id) REFERENCES sylius_invoicing_plugin_invoice (id) ON DELETE CASCADE');
31+
}
32+
33+
public function down(Schema $schema): void
34+
{
35+
// this down() migration is auto-generated, please modify it to your needs
36+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
37+
38+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_line_item DROP FOREIGN KEY FK_C91408292989F1FD');
39+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP FOREIGN KEY FK_3AA279BF5CDB2AEB');
40+
$this->addSql('DROP TABLE sylius_invoicing_plugin_invoice');
41+
$this->addSql('DROP TABLE sylius_invoicing_plugin_line_item');
42+
$this->addSql('DROP TABLE sylius_invoicing_plugin_billing_data');
43+
}
44+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
/**
20+
* Auto-generated Migration: Please modify to your needs!
21+
*/
22+
final class Version20180711070226 extends AbstractMigration
23+
{
24+
public function up(Schema $schema): void
25+
{
26+
// this up() migration is auto-generated, please modify it to your needs
27+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
28+
29+
$this->addSql('CREATE TABLE sylius_invoicing_plugin_tax_item (id INT AUTO_INCREMENT NOT NULL, invoice_id VARCHAR(255) NOT NULL, `label` VARCHAR(255) NOT NULL, amount INT NOT NULL, INDEX IDX_2951C61C2989F1FD (invoice_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB');
30+
$this->addSql('CREATE TABLE sylius_invoicing_plugin_shop_billing_data (id INT AUTO_INCREMENT NOT NULL, company VARCHAR(255) NOT NULL, tax_id VARCHAR(255) NOT NULL, street VARCHAR(255) NOT NULL, city VARCHAR(255) NOT NULL, postcode VARCHAR(255) NOT NULL, country_code VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_unicode_ci ENGINE = InnoDB');
31+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_tax_item ADD CONSTRAINT FK_2951C61C2989F1FD FOREIGN KEY (invoice_id) REFERENCES sylius_invoicing_plugin_invoice (id) ON DELETE CASCADE');
32+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP tax_total');
33+
$this->addSql('ALTER TABLE sylius_channel ADD billing_data_id INT DEFAULT NULL, ADD taxId VARCHAR(255) DEFAULT NULL');
34+
$this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119E5CDB2AEB FOREIGN KEY (billing_data_id) REFERENCES sylius_invoicing_plugin_shop_billing_data (id)');
35+
$this->addSql('CREATE UNIQUE INDEX UNIQ_16C8119E5CDB2AEB ON sylius_channel (billing_data_id)');
36+
}
37+
38+
public function down(Schema $schema): void
39+
{
40+
// this down() migration is auto-generated, please modify it to your needs
41+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
42+
43+
$this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119E5CDB2AEB');
44+
$this->addSql('DROP TABLE sylius_invoicing_plugin_tax_item');
45+
$this->addSql('DROP TABLE sylius_invoicing_plugin_shop_billing_data');
46+
$this->addSql('DROP INDEX UNIQ_16C8119E5CDB2AEB ON sylius_channel');
47+
$this->addSql('ALTER TABLE sylius_channel DROP billing_data_id, DROP taxId');
48+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD tax_total INT NOT NULL');
49+
}
50+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
/**
20+
* Auto-generated Migration: Please modify to your needs!
21+
*/
22+
final class Version20180711084815 extends AbstractMigration
23+
{
24+
public function up(Schema $schema): void
25+
{
26+
// this up() migration is auto-generated, please modify it to your needs
27+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
28+
29+
$this->addSql('CREATE TABLE sylius_invoicing_plugin_sequence (id INTEGER NOT NULL, idx INTEGER NOT NULL, version INTEGER DEFAULT 1 NOT NULL, PRIMARY KEY(id))');
30+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD number VARCHAR(255) NOT NULL');
31+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_sequence CHANGE id id INT AUTO_INCREMENT NOT NULL');
32+
}
33+
34+
public function down(Schema $schema): void
35+
{
36+
// this down() migration is auto-generated, please modify it to your needs
37+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
38+
39+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP number');
40+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_sequence CHANGE id id INT NOT NULL');
41+
$this->addSql('DROP TABLE sylius_invoicing_plugin_sequence');
42+
}
43+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
/**
20+
* Auto-generated Migration: Please modify to your needs!
21+
*/
22+
final class Version20180801083047 extends AbstractMigration
23+
{
24+
public function up(Schema $schema): void
25+
{
26+
// this up() migration is auto-generated, please modify it to your needs
27+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
28+
29+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD locale_code VARCHAR(255) NOT NULL');
30+
}
31+
32+
public function down(Schema $schema): void
33+
{
34+
// this down() migration is auto-generated, please modify it to your needs
35+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
36+
37+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP locale_code');
38+
}
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
/**
20+
* Auto-generated Migration: Please modify to your needs!
21+
*/
22+
final class Version20180826064735 extends AbstractMigration
23+
{
24+
public function up(Schema $schema): void
25+
{
26+
// this up() migration is auto-generated, please modify it to your needs
27+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
28+
29+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD channel_code VARCHAR(255), ADD channel_name VARCHAR(255)');
30+
}
31+
32+
public function down(Schema $schema): void
33+
{
34+
// this down() migration is auto-generated, please modify it to your needs
35+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
36+
37+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP channel_code, DROP channel_name');
38+
}
39+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
/**
20+
* Auto-generated Migration: Please modify to your needs!
21+
*/
22+
final class Version20190103134228 extends AbstractMigration
23+
{
24+
public function up(Schema $schema): void
25+
{
26+
// this up() migration is auto-generated, please modify it to your needs
27+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
28+
29+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD shopBillingData_company VARCHAR(255) DEFAULT NULL, ADD shopBillingData_tax_id VARCHAR(255) DEFAULT NULL, ADD shopBillingData_street VARCHAR(255) DEFAULT NULL, ADD shopBillingData_city VARCHAR(255) DEFAULT NULL, ADD shopBillingData_postcode VARCHAR(255) DEFAULT NULL, ADD shopBillingData_country_code VARCHAR(255) DEFAULT NULL');
30+
}
31+
32+
public function down(Schema $schema): void
33+
{
34+
// this down() migration is auto-generated, please modify it to your needs
35+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
36+
37+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP shopBillingData_company, DROP shopBillingData_tax_id, DROP shopBillingData_street, DROP shopBillingData_city, DROP shopBillingData_postcode, DROP shopBillingData_country_code');
38+
}
39+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Sylius package.
5+
*
6+
* (c) Sylius Sp. z o.o.
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Sylius\InvoicingPlugin\Migrations;
15+
16+
use Doctrine\DBAL\Schema\Schema;
17+
use Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20190604071441 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
// this up() migration is auto-generated, please modify it to your needs
24+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
25+
26+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD shopBillingData_representative VARCHAR(255) DEFAULT NULL');
27+
}
28+
29+
public function down(Schema $schema): void
30+
{
31+
// this down() migration is auto-generated, please modify it to your needs
32+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
33+
34+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP shopBillingData_representative');
35+
}
36+
}

0 commit comments

Comments
 (0)