Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add database migration for adding token_idx and channel_shop_user_token_idx indexes to database #230

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/Migrations/Version20231030194730.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/*
* This file was created by developers working at BitBag
* Do you need more information about us and what we do? Visit our https://bitbag.io website!
* We are hiring developers from all over the world. Join us and start your new, exciting adventure and become part of us: https://bitbag.io/career
*/

declare(strict_types=1);

namespace BitBag\SyliusWishlistPlugin\Migrations;

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

final class Version20231030194730 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds token_idx and channel_shop_user_token_idx indexes to database';
}

public function up(Schema $schema): void
{
$this->addSql('CREATE INDEX token_idx ON bitbag_wishlist (token)');
$this->addSql('CREATE INDEX channel_shop_user_token_idx ON bitbag_wishlist (channel_id, shop_user_id, token)');
}

public function down(Schema $schema): void
{
$this->addSql('DROP INDEX token_idx ON bitbag_wishlist');
$this->addSql('DROP INDEX channel_shop_user_token_idx ON bitbag_wishlist');
}
}
Loading