Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2270360
2021_12_28_103243_create_policy_ratelimit_tables.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
2021_12_28_103243_create_policy_ratelimit_tables.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment