- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateRevisionsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('revisions', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('member_id')->unique();
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->unsignedInteger('revisor_id')->nullable();
|
||||
$table->json('data');
|
||||
$table->timestamps();
|
||||
$table->timestamp('accepted_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::table('revisions', function (Blueprint $table) {
|
||||
$table->foreign('member_id')->references('id')->on('members')->onDelete('cascade');
|
||||
$table->foreign('user_id')->references('id')->on('users');
|
||||
$table->foreign('revisor_id')->references('id')->on('users');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('revisions', function (Blueprint $table) {
|
||||
$table->dropForeign('revisions_member_id_foreign');
|
||||
$table->dropForeign('revisions_user_id_foreign');
|
||||
$table->dropForeign('revisions_revisor_id_foreign');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('revisions');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user