Page MenuHomePhorge

2021_12_28_103243_create_policy_ratelimit_tables.php
No OneTemporary

2021_12_28_103243_create_policy_ratelimit_tables.php

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
// phpcs:ignore
class CreatePolicyRatelimitTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(
'policy_ratelimit',
function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('user_id');
$table->bigInteger('owner_id');
$table->string('recipient_hash', 128);
$table->tinyInteger('recipient_count')->unsigned();
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('owner_id')->references('id')->on('users')->onDelete('cascade');
$table->index(['user_id', 'updated_at']);
$table->index(['owner_id', 'updated_at']);
$table->index(['user_id', 'recipient_hash', 'updated_at']);
}
);
Schema::create(
'policy_ratelimit_wl',
function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('whitelistable_id');
$table->string('whitelistable_type');
$table->timestamps();
$table->index(['whitelistable_id', 'whitelistable_type']);
$table->unique(['whitelistable_id', 'whitelistable_type']);
}
);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('policy_ratelimit');
Schema::dropIfExists('policy_ratelimit_wl');
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 11, 10:43 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
324323
Default Alt Text
2021_12_28_103243_create_policy_ratelimit_tables.php (1 KB)

Event Timeline