mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-24 21:05:03 +02:00
Added internal part number field to parts
This commit is contained in:
parent
81abf36867
commit
b1d359f538
12 changed files with 123 additions and 3 deletions
44
migrations/Version20221204004815.php
Normal file
44
migrations/Version20221204004815.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use App\Migration\AbstractMultiPlatformMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20221204004815 extends AbstractMultiPlatformMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add IPN to part';
|
||||
}
|
||||
|
||||
public function mySQLUp(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE parts ADD ipn VARCHAR(100) DEFAULT NULL');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_6940A7FE3D721C14 ON parts (ipn)');
|
||||
$this->addSql('CREATE INDEX parts_idx_ipn ON parts (ipn)');
|
||||
}
|
||||
|
||||
public function mySQLDown(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP INDEX UNIQ_6940A7FE3D721C14 ON `parts`');
|
||||
$this->addSql('DROP INDEX parts_idx_ipn ON `parts`');
|
||||
$this->addSql('ALTER TABLE `parts` DROP ipn');
|
||||
}
|
||||
|
||||
public function sqLiteUp(Schema $schema): void
|
||||
{
|
||||
// TODO: Implement sqLiteUp() method.
|
||||
}
|
||||
|
||||
public function sqLiteDown(Schema $schema): void
|
||||
{
|
||||
// TODO: Implement sqLiteDown() method.
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue