User/rework
This commit is contained in:
25
db/migrations/20250314130000_woker_add_active.php
Normal file
25
db/migrations/20250314130000_woker_add_active.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class WorkerAddActive extends AbstractMigration {
|
||||
public function up(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$workerTable = $this->table("Worker");
|
||||
$workerTable
|
||||
->addColumn("active", "integer", ['default' => 1])
|
||||
->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void {
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$workerTable = $this->table("Worker");
|
||||
$workerTable
|
||||
->removeColumn("active")
|
||||
->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//SQL: ALTER TABLE Worker ADD COLUMN active INT DEFAULT 1;
|
||||
Reference in New Issue
Block a user