- 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,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateAccreditationsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('accreditations', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->unsignedInteger('learning_product_id');
|
||||
$table->string('credits')->nullable();
|
||||
$table->dateTime('date_start', 0)->nullable();
|
||||
$table->dateTime('date_end', 0)->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('accreditations', function (Blueprint $table) {
|
||||
$table->foreign('learning_product_id')->references('id')->on('learning_products')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('accreditations', function (Blueprint $table) {
|
||||
$table->dropForeign('accreditations_learning_product_id_foreign');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('accreditations');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user