1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
-
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
-
- class CreateRubricsTable extends Migration
- {
-
- public function up()
- {
- Schema::create('rubrics', function (Blueprint $table) {
- $table->increments('id');
- $table->string('name');
-
- $table->integer('expected_percentage');
- $table->integer('expected_points');
- $table->integer('user_id')->unsigned();
- $table->timestamps();
- $table->integer('num_scales')->unsigned();
- $table->integer('max_score')->unsigned();
- });
-
- Schema::table('rubrics', function (Blueprint $table) {
- $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
- });
- }
-
-
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::drop('rubrics');
- }
- }
|