From 6a2b764b97a02110370e983b78aaf4957715e65e Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 7 Feb 2022 01:59:58 +0100 Subject: [PATCH] new: [flood protection] schema added --- ...07000000_registration_flood_protection.php | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 config/Migrations/20220207000000_registration_flood_protection.php diff --git a/config/Migrations/20220207000000_registration_flood_protection.php b/config/Migrations/20220207000000_registration_flood_protection.php new file mode 100644 index 0000000..d8d1cdf --- /dev/null +++ b/config/Migrations/20220207000000_registration_flood_protection.php @@ -0,0 +1,47 @@ +hasTable('flood_protections'); + if (!$exists) { + $table = $this->table('flood_protections', [ + 'signed' => false, + 'collation' => 'utf8mb4_unicode_ci', + ]); + $table + ->addColumn('remote_ip', 'string', [ + 'null' => false, + 'length' => 45, + ]) + ->addColumn('request_action', 'string', [ + 'null' => false, + 'length' => 191, + ]) + ->addColumn('expiration', 'integer', [ + 'null' => false, + 'signed' => false, + 'length' => 10, + ]) + ->addIndex('remote_ip') + ->addIndex('request_action') + ->addIndex('expiration'); + $table->create(); + } + } +}