mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-22 10:59:31 +00:00
First order details draft
This commit is contained in:
parent
1a0fab0615
commit
62754bdbf3
13 changed files with 170 additions and 7 deletions
38
migrations/Version20240905085300.php
Normal file
38
migrations/Version20240905085300.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use App\Migration\AbstractMultiPlatformMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
final class Version20240905085300 extends AbstractMultiPlatformMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Added order fields';
|
||||
}
|
||||
|
||||
public function mySQLUp(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE parts ADD orderamount DOUBLE PRECISION NOT NULL DEFAULT 0, ADD orderDate DATETIME');
|
||||
}
|
||||
|
||||
public function mySQLDown(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE `parts` DROP orderamount, DROP orderDate');
|
||||
}
|
||||
|
||||
public function sqLiteUp(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE parts ADD COLUMN orderamount DOUBLE PRECISION NOT NULL DEFAULT 0');
|
||||
$this->addSql('ALTER TABLE parts ADD COLUMN orderDate DATETIME');
|
||||
}
|
||||
|
||||
public function sqLiteDown(Schema $schema): void
|
||||
{
|
||||
$error;
|
||||
// TODO: implement backwards migration for SQlite
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue