-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[shopsys] Role ROLE_ALL_API sees all company complaints (#3534)
Co-authored-by: Michal Vanek <[email protected]>
- Loading branch information
Showing
2 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shopsys\FrameworkBundle\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration; | ||
|
||
final class Version20241023142037 extends AbstractMigration | ||
{ | ||
/** | ||
* @param \Doctrine\DBAL\Schema\Schema $schema | ||
*/ | ||
public function up(Schema $schema): void | ||
{ | ||
$this->sql('ALTER TABLE complaints ADD customer_id INT DEFAULT NULL'); | ||
$this->sql('UPDATE complaints c SET customer_id = cu.customer_id FROM customer_users cu WHERE cu.id = c.customer_user_id'); | ||
$this->sql( | ||
' | ||
ALTER TABLE | ||
complaints | ||
ADD | ||
CONSTRAINT FK_A05AAF3A9395C3F3 FOREIGN KEY (customer_id) REFERENCES customers (id) ON DELETE | ||
SET | ||
NULL NOT DEFERRABLE INITIALLY IMMEDIATE', | ||
); | ||
$this->sql('CREATE INDEX IDX_A05AAF3A9395C3F3 ON complaints (customer_id)'); | ||
} | ||
|
||
/** | ||
* @param \Doctrine\DBAL\Schema\Schema $schema | ||
*/ | ||
public function down(Schema $schema): void | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters