Skip to content

Commit 74853f9

Browse files
Revert regenerating migrations in 1.0 (#368)
2 parents e378c18 + 88533a2 commit 74853f9

16 files changed

+566
-82
lines changed

src/Migrations/Version20180625120743.php

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20180626120743 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$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');
24+
$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');
25+
$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');
26+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD CONSTRAINT FK_3AA279BF5CDB2AEB FOREIGN KEY (billing_data_id) REFERENCES sylius_invoicing_plugin_billing_data (id)');
27+
$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');
28+
}
29+
30+
public function down(Schema $schema): void
31+
{
32+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_line_item DROP FOREIGN KEY FK_C91408292989F1FD');
33+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP FOREIGN KEY FK_3AA279BF5CDB2AEB');
34+
$this->addSql('DROP TABLE sylius_invoicing_plugin_invoice');
35+
$this->addSql('DROP TABLE sylius_invoicing_plugin_line_item');
36+
$this->addSql('DROP TABLE sylius_invoicing_plugin_billing_data');
37+
}
38+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20180711070226 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$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');
24+
$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');
25+
$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');
26+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP tax_total');
27+
$this->addSql('ALTER TABLE sylius_channel ADD billing_data_id INT DEFAULT NULL, ADD taxId VARCHAR(255) DEFAULT NULL');
28+
$this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119E5CDB2AEB FOREIGN KEY (billing_data_id) REFERENCES sylius_invoicing_plugin_shop_billing_data (id)');
29+
$this->addSql('CREATE UNIQUE INDEX UNIQ_16C8119E5CDB2AEB ON sylius_channel (billing_data_id)');
30+
}
31+
32+
public function down(Schema $schema): void
33+
{
34+
$this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119E5CDB2AEB');
35+
$this->addSql('DROP TABLE sylius_invoicing_plugin_tax_item');
36+
$this->addSql('DROP TABLE sylius_invoicing_plugin_shop_billing_data');
37+
$this->addSql('DROP INDEX UNIQ_16C8119E5CDB2AEB ON sylius_channel');
38+
$this->addSql('ALTER TABLE sylius_channel DROP billing_data_id, DROP taxId');
39+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD tax_total INT NOT NULL');
40+
}
41+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20180711084815 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$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))');
24+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD number VARCHAR(255) NOT NULL');
25+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_sequence CHANGE id id INT AUTO_INCREMENT NOT NULL');
26+
}
27+
28+
public function down(Schema $schema): void
29+
{
30+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP number');
31+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_sequence CHANGE id id INT NOT NULL');
32+
$this->addSql('DROP TABLE sylius_invoicing_plugin_sequence');
33+
}
34+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20180801083047 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD locale_code VARCHAR(255) NOT NULL');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP locale_code');
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20180826064735 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD channel_code VARCHAR(255), ADD channel_name VARCHAR(255)');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP channel_code, DROP channel_name');
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20190103134228 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$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');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
$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');
29+
}
30+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20190604071441 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice ADD shopBillingData_representative VARCHAR(255) DEFAULT NULL');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
$this->addSql('ALTER TABLE sylius_invoicing_plugin_invoice DROP shopBillingData_representative');
29+
}
30+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 Sylius\Bundle\CoreBundle\Doctrine\Migrations\AbstractMigration;
18+
19+
final class Version20190607001446 extends AbstractMigration
20+
{
21+
public function up(Schema $schema): void
22+
{
23+
$this->addSql('ALTER TABLE sylius_channel DROP FOREIGN KEY FK_16C8119E5CDB2AEB');
24+
$this->addSql('DROP INDEX UNIQ_16C8119E5CDB2AEB ON sylius_channel');
25+
$this->addSql('ALTER TABLE sylius_channel DROP billing_data_id, DROP taxId');
26+
}
27+
28+
public function down(Schema $schema): void
29+
{
30+
$this->addSql('ALTER TABLE sylius_channel ADD billing_data_id INT DEFAULT NULL, ADD taxId VARCHAR(255) DEFAULT NULL COLLATE utf8_unicode_ci');
31+
$this->addSql('ALTER TABLE sylius_channel ADD CONSTRAINT FK_16C8119E5CDB2AEB FOREIGN KEY (billing_data_id) REFERENCES sylius_invoicing_plugin_shop_billing_data (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
32+
$this->addSql('CREATE UNIQUE INDEX UNIQ_16C8119E5CDB2AEB ON sylius_channel (billing_data_id)');
33+
}
34+
}

0 commit comments

Comments
 (0)