app/DoctrineMigrations/Version20251128000000.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * 発送ツールテンプレート管理テーブルを追加
  8.  */
  9. final class Version20251128000000 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '発送ツールテンプレート管理テーブル(dtb_shipping_label_template)を追加';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         if ($schema->hasTable('dtb_shipping_label_template')) {
  18.             return;
  19.         }
  20.         $table $schema->createTable('dtb_shipping_label_template');
  21.         $table->addColumn('id''integer', ['autoincrement' => true'notnull' => true]);
  22.         $table->addColumn('name''string', ['length' => 255'notnull' => true]);
  23.         $table->addColumn('seal_count_vertical''integer', ['notnull' => true]);
  24.         $table->addColumn('seal_count_horizontal''integer', ['notnull' => true]);
  25.         $table->addColumn('margin_vertical''decimal', ['precision' => 10'scale' => 2'notnull' => true]);
  26.         $table->addColumn('margin_horizontal''decimal', ['precision' => 10'scale' => 2'notnull' => true]);
  27.         $table->addColumn('seal_spacing_vertical''decimal', ['precision' => 10'scale' => 2'notnull' => true]);
  28.         $table->addColumn('seal_spacing_horizontal''decimal', ['precision' => 10'scale' => 2'notnull' => true]);
  29.         $table->addColumn('items_config''text', ['notnull' => false'comment' => 'JSON format for items configuration']);
  30.         $table->addColumn('create_date''datetime', ['notnull' => true]);
  31.         $table->addColumn('update_date''datetime', ['notnull' => true]);
  32.         $table->setPrimaryKey(['id']);
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         $schema->dropTable('dtb_shipping_label_template');
  37.     }
  38. }