diff --git a/config/Migrations/20210612140828_RemoteToolConnections.php b/config/Migrations/20210612140828_RemoteToolConnections.php new file mode 100644 index 0000000..b75e112 --- /dev/null +++ b/config/Migrations/20210612140828_RemoteToolConnections.php @@ -0,0 +1,84 @@ +table('remote_tool_connections', [ + 'signed' => false, + 'collation' => 'utf8mb4_unicode_ci', + ]); + $table + ->addColumn('id', 'integer', [ + 'autoIncrement' => true, + 'limit' => 10, + 'signed' => false, + ]) + ->addPrimaryKey('id') + ->addColumn('local_tool_id', 'integer', [ + 'null' => false, + 'signed' => false, + 'length' => 10, + ]) + ->addColumn('remote_tool_id', 'integer', [ + 'null' => false, + 'signed' => false, + 'length' => 10, + ]) + ->addColumn('remote_tool_name', 'string', [ + 'null' => false, + 'limit' => 191, + ]) + ->addColumn('brood_id', 'integer', [ + 'null' => false, + 'signed' => false, + 'length' => 10, + ]) + ->addColumn('name', 'string', [ + 'null' => true, + 'limit' => 191, + ]) + ->addColumn('settings', 'text', [ + 'null' => true, + 'limit' => MysqlAdapter::TEXT_LONG + ]) + ->addColumn('status', 'string', [ + 'null' => true, + 'limit' => 32, + 'encoding' => 'ascii', + ]) + ->addColumn('created', 'datetime', [ + 'default' => null, + 'null' => false, + ]) + ->addColumn('modified', 'datetime', [ + 'default' => null, + 'null' => false, + ]); + + $table->addForeignKey('local_tool_id', 'local_tools', 'id', ['delete'=> 'CASCADE', 'update'=> 'CASCADE']); + + $table->addIndex('remote_tool_id') + ->addIndex('remote_tool_name') + ->addIndex('status') + ->addIndex('name'); + + $table->create(); + } +} +