From af69834727f5a29d9fec6927d1b980b740308332 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Sat, 12 Jun 2021 14:26:31 +0200 Subject: [PATCH] new: [migration:remoteToolConnections] Added migration file --- .../20210612140828_RemoteToolConnections.php | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 config/Migrations/20210612140828_RemoteToolConnections.php 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(); + } +} +