Skip to content

Commit

Permalink
move Version20240902171506 migration to the proper namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-rostislav committed Nov 19, 2024
1 parent 1ab63f8 commit 804ed76
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Migrations/Version20240902171506.php
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
{
}
}

0 comments on commit 804ed76

Please sign in to comment.