mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Add FollowRequest model/migration
This commit is contained in:
parent
a9b7117db9
commit
f9fc8e2f64
2 changed files with 53 additions and 0 deletions
18
app/FollowRequest.php
Normal file
18
app/FollowRequest.php
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class FollowRequest extends Model
|
||||||
|
{
|
||||||
|
public function follower()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Profile::class, 'follower_id', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function following()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Profile::class, 'following_id', 'id');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class CreateFollowRequestsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('follow_requests', function (Blueprint $table) {
|
||||||
|
$table->bigIncrements('id');
|
||||||
|
$table->bigInteger('follower_id')->unsigned()->index();
|
||||||
|
$table->bigInteger('following_id')->unsigned()->index();
|
||||||
|
$table->boolean('is_rejected')->default(false);
|
||||||
|
$table->boolean('is_local')->default(false);
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('follow_requests');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue