raspberrydisplay v2 init

This commit is contained in:
Luca Haid
2026-02-03 15:38:55 +01:00
parent 10ecfab41d
commit 0cdb2140a9
7 changed files with 2065 additions and 341 deletions

View File

@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class RevampRaspberryDisplayTable extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$this->table('RaspberryDisplay')->drop()->save();
$this->table('RaspberryDisplay')
->addColumn('display_label', 'string', ['limit' => 255, 'null' => false])
->addColumn('hostname', 'string', ['limit' => 255, 'null' => true])
->addColumn('ip_address', 'string', ['limit' => 45, 'null' => false])
->addColumn('display_url', 'text', ['null' => true])
->addColumn('group_name', 'string', ['limit' => 100, 'null' => false])
->addColumn('group_order', 'integer', ['default' => 0])
->addColumn('monitor_size', 'enum', ['values' => ['27', '42', '55', '65'], 'default' => '27'])
->addColumn('hdmi_port', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => 0])
->addColumn('agent_port', 'integer', ['default' => 5000])
->addColumn('custom_style', 'text', ['null' => true])
->addColumn('create', 'integer', ['null' => true])
->addColumn('edit', 'integer', ['null' => true])
->addColumn('create_by', 'integer', ['null' => true])
->addColumn('edit_by', 'integer', ['null' => true])
->addIndex(['group_name'])
->addIndex(['ip_address'])
->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table('RaspberryDisplay')->drop()->save();
$this->table('RaspberryDisplay')
->addColumn('display_label', 'string', ['limit' => 255])
->addColumn('hostname', 'string', ['limit' => 255])
->addColumn('ip_address', 'string', ['limit' => 15])
->addColumn('display_url', 'string', ['limit' => 255])
->addColumn('auto_refresh_enabled', 'boolean', ['default' => false])
->addColumn('margin_hot_fix_enabled', 'boolean', ['default' => false])
->addColumn('custom_style', 'string', ['limit' => 255, 'null' => true])
->addColumn('create', 'integer', ['null' => true])
->addColumn('edit', 'integer', ['null' => true])
->addColumn('create_by', 'integer', ['null' => true])
->addColumn('edit_by', 'integer', ['null' => true])
->create();
}
if($this->getEnvironment() == "addressdb") {
}
}
}