table('manual_blocks'); $table->addColumn('kind', 'string', ['limit' => 16, 'null' => false]); $this->addIpBinaryColumn($table, 'ip_bin', ['null' => true]); $this->addIpBinaryColumn($table, 'network_bin', ['null' => true]); $table->addColumn('prefix_length', 'smallinteger', ['null' => true, 'signed' => false]); $table->addColumn('reason', 'text', ['null' => true]); $table->addColumn('created_by_user_id', 'integer', ['null' => true, 'signed' => false]); $this->addTimestampColumn($table, 'expires_at', ['null' => true]); $this->addTimestampColumn($table, 'created_at'); $table ->addIndex(['ip_bin'], ['name' => 'idx_manual_blocks_ip_bin']) ->addIndex(['network_bin'], ['name' => 'idx_manual_blocks_network_bin']) ->addIndex(['kind']) ->addIndex(['created_by_user_id']) ->addForeignKey( 'created_by_user_id', 'users', 'id', ['delete' => 'SET_NULL', 'update' => 'NO_ACTION', 'constraint' => 'fk_manual_blocks_created_by'] ) ->create(); } }