Added UserEvent.php
This commit is contained in:
@@ -13,13 +13,13 @@ class CreateResourceCategories extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('resource_categories', function (Blueprint $table) {
|
||||
/*Schema::create('resource_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string("name")->unique();
|
||||
$table->text("description");
|
||||
$table->string("slug")->unique();
|
||||
$table->timestamps();
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateUserEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('user_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->integer("user_id")->unique();
|
||||
$table->integer("event_id")->unique();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign("user_id")->references("id")->on("users");
|
||||
$table->foreign("event_id")->references("id")->on("events");
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('user_events');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user