12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
-
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
-
- class CreateProgramUserTable extends Migration {
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('program_user', function(Blueprint $table)
- {
- $table->engine = 'InnoDB';
- $table->increments('id');
- $table->integer('program_id')->unsigned();
- $table->foreign('program_id')
- ->references('id')
- ->on('programs')
- ->onDelete('cascade')
- ->onUpdate('cascade');
- $table->integer('user_id')->unsigned();
- $table->foreign('user_id')
- ->references('id')
- ->on('users')
- ->onDelete('cascade')
- ->onUpdate('cascade');
- $table->timestamps();
- });
- }
-
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('program_user');
- }
-
- }
|