mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-01 12:59:36 +00:00
Add a kicad_export checkbox to parameters, allowing users to control which specifications appear as fields in the KiCad HTTP library API. Parameters with kicad_export enabled are included using their formatted value, without overwriting hardcoded fields like description or Stock.
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use App\Migration\AbstractMultiPlatformMigration;
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
|
|
final class Version20260208190000 extends AbstractMultiPlatformMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return 'Add kicad_export boolean column to parameters table';
|
|
}
|
|
|
|
public function mySQLUp(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE parameters ADD kicad_export TINYINT(1) NOT NULL DEFAULT 0');
|
|
}
|
|
|
|
public function mySQLDown(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE parameters DROP COLUMN kicad_export');
|
|
}
|
|
|
|
public function sqLiteUp(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE parameters ADD COLUMN kicad_export BOOLEAN NOT NULL DEFAULT 0');
|
|
}
|
|
|
|
public function sqLiteDown(Schema $schema): void
|
|
{
|
|
// SQLite does not support DROP COLUMN in older versions; recreate table if needed
|
|
$this->addSql('ALTER TABLE parameters DROP COLUMN kicad_export');
|
|
}
|
|
|
|
public function postgreSQLUp(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE parameters ADD kicad_export BOOLEAN NOT NULL DEFAULT FALSE');
|
|
}
|
|
|
|
public function postgreSQLDown(Schema $schema): void
|
|
{
|
|
$this->addSql('ALTER TABLE parameters DROP COLUMN kicad_export');
|
|
}
|
|
}
|