Files
thetool/db/migrations/20240104201005_create_system_table.php
2024-01-05 13:56:02 +01:00

39 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateSystemTable extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("System");
$table->addColumn("active", "integer", ["null" => false, "default" => 1, "limit" => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY]);
$table->addColumn("name", "string", ["null" => false, "limit" => 255]);
$table->addColumn("value", "string", ["null" => false, "limit" => 1024]);
$table->addColumn("type", "enum", ["null" => false, "values" => 'int,float,string,json']);
$table->addColumn("create_by", "integer", ["null" => false]);
$table->addColumn("edit_by", "integer", ["null" => false]);
$table->addColumn("create", "integer", ["null" => false]);
$table->addColumn("edit", "integer", ["null" => false]);
$table->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("System")->drop();
}
if($this->getEnvironment() == "addressdb") {
}
}
}