Skip to content

Commit

Permalink
Merge pull request #82 from BitBagCommerce/feature/missing_migrations
Browse files Browse the repository at this point in the history
Missing migrations (refresh_token, product_attribute_value)
  • Loading branch information
senghe authored Jun 15, 2023
2 parents ac235f0 + a5b130b commit 807d6e4
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
33 changes: 33 additions & 0 deletions migrations/Version20230612094617.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace App\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20230612094617 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create refresh token table';
}

public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE IF NOT EXISTS bitbag_refresh_token (id INT AUTO_INCREMENT NOT NULL, refresh_token VARCHAR(128) NOT NULL, username VARCHAR(255) NOT NULL, valid DATETIME NOT NULL, remember_me TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_CD7BD0E9C74F2195 (refresh_token), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB');
}

public function down(Schema $schema): void
{
$this->addSql('DROP TABLE bitbag_refresh_token');
}
}
33 changes: 33 additions & 0 deletions migrations/Version20230612095046.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on [email protected].
*/

declare(strict_types=1);

namespace App\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20230612095046 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add index to sylius_product_attribute_value table on `locale_code`';
}

public function up(Schema $schema): void
{
$this->addSql('CREATE INDEX locale_code ON sylius_product_attribute_value (locale_code)');
}

public function down(Schema $schema): void
{
$this->addSql('DROP INDEX locale_code ON sylius_product_attribute_value');
}
}
3 changes: 3 additions & 0 deletions tests/Application/config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ doctrine_migrations:
storage:
table_storage:
table_name: sylius_migrations

migrations_paths:
'migrations': '%kernel.project_dir%/../../migrations'

0 comments on commit 807d6e4

Please sign in to comment.