table('outbox', [ 'signed' => false, 'collation' => 'utf8mb4_unicode_ci', ]); $table ->addColumn('id', 'integer', [ 'autoIncrement' => true, 'limit' => 10, 'signed' => false, ]) ->addPrimaryKey('id') ->addColumn('uuid', 'uuid', [ 'default' => null, 'null' => false, ]) ->addColumn('scope', 'string', [ 'default' => null, 'null' => false, 'limit' => 191, 'comment' => 'The to model linked with the message', ]) ->addColumn('action', 'string', [ 'default' => null, 'null' => false, 'limit' => 191, 'comment' => 'The action linked with the message', ]) ->addColumn('title', 'string', [ 'default' => null, 'null' => false, 'limit' => 191, ]) ->addColumn('user_id', 'integer', [ 'default' => null, 'null' => true, 'signed' => false, 'length' => 10, ]) ->addColumn('comment', 'text', [ 'default' => null, 'null' => true, ]) ->addColumn('description', 'text', [ 'default' => null, 'null' => true, ]) ->addColumn('data', 'text', [ 'default' => null, 'null' => true, 'limit' => MysqlAdapter::TEXT_LONG ]) ->addColumn('created', 'datetime', [ 'default' => null, 'null' => false, ]); $table->addForeignKey('user_id', 'users', 'id', ['delete'=> 'CASCADE', 'update'=> 'CASCADE']); $table->addIndex(['uuid'], ['unique' => true]) ->addIndex('scope') ->addIndex('action') ->addIndex('title') ->addIndex('created') ->addIndex('user_id'); $table->create(); } }