mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Add HashtagFollow model, migration and controller
This commit is contained in:
parent
8bdab9bb67
commit
d07c3deb86
3 changed files with 55 additions and 0 deletions
10
app/HashtagFollow.php
Normal file
10
app/HashtagFollow.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class HashtagFollow extends Model
|
||||
{
|
||||
//
|
||||
}
|
10
app/Http/Controllers/HashtagFollowController.php
Normal file
10
app/Http/Controllers/HashtagFollowController.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HashtagFollowController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateHashtagFollowsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('hashtag_follows', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigInteger('user_id')->unsigned()->index();
|
||||
$table->bigInteger('profile_id')->unsigned()->index();
|
||||
$table->bigInteger('hashtag_id')->unsigned()->index();
|
||||
$table->unique(['user_id', 'profile_id', 'hashtag_id']);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('hashtag_follows');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue