mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 07:42:41 +00:00
Add DiscoverCategoryHashtag model
This commit is contained in:
parent
32d1667311
commit
40ffaee6ed
3 changed files with 57 additions and 0 deletions
13
app/DiscoverCategoryHashtag.php
Normal file
13
app/DiscoverCategoryHashtag.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DiscoverCategoryHashtag extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'discover_category_id',
|
||||
'hashtag_id'
|
||||
];
|
||||
}
|
10
app/Http/Controllers/DiscoverCategoryHashtagController.php
Normal file
10
app/Http/Controllers/DiscoverCategoryHashtagController.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DiscoverCategoryHashtagController extends Controller
|
||||
{
|
||||
//
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class CreateDiscoverCategoryHashtagsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('discover_category_hashtags', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigInteger('discover_category_id')->unsigned()->index();
|
||||
$table->bigInteger('hashtag_id')->unsigned()->index();
|
||||
$table->unique(['discover_category_id', 'hashtag_id'], 'disc_hashtag_unique');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('discover_category_hashtags');
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue