-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move Version20240902171506 migration to the proper namespace
- Loading branch information
1 parent
1ab63f8
commit 804ed76
Showing
1 changed file
with
31 additions
and
0 deletions.
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shopsys\FrameworkBundle\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration; | ||
|
||
class Version20240902171506 extends AbstractMigration | ||
{ | ||
/** | ||
* @param \Doctrine\DBAL\Schema\Schema $schema | ||
*/ | ||
public function up(Schema $schema): void | ||
{ | ||
$this->sql('ALTER TABLE transport_prices ADD max_weight INT DEFAULT NULL'); | ||
$this->sql('UPDATE transport_prices SET max_weight = (SELECT max_weight FROM transports WHERE transports.id = transport_prices.transport_id)'); | ||
|
||
$this->sql('ALTER TABLE transport_prices DROP CONSTRAINT transport_prices_pkey'); | ||
$this->sql('ALTER TABLE transport_prices ADD id SERIAL NOT NULL'); | ||
$this->sql('ALTER TABLE transport_prices ADD PRIMARY KEY (id)'); | ||
} | ||
|
||
/** | ||
* @param \Doctrine\DBAL\Schema\Schema $schema | ||
*/ | ||
public function down(Schema $schema): void | ||
{ | ||
} | ||
} |