1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
-
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
-
- class CreateProgramsTable extends Migration {
-
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('programs', function(Blueprint $table)
- {
- $table->engine = 'InnoDB';
- $table->increments('id');
- $table->string('name', 50);
- $table->integer('school_id')->unsigned();
- $table->boolean('restrict_rubrics')->default(false);
- $table->timestamps();
- });
-
- Schema::table('programs', function(Blueprint $table)
- {
- $table->foreign('school_id')->references('id')->on('schools')->onDelete('cascade')->onUpdate('cascade');
- });
- }
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('programs');
- }
-
- }
|