| 1 | <?php |
||
| 6 | class CreatePropertyBagTable extends Migration |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Run the migrations. |
||
| 10 | * |
||
| 11 | * @return void |
||
| 12 | */ |
||
| 13 | public function up() |
||
| 14 | { |
||
| 15 | Schema::create('property_bag', function (Blueprint $table) { |
||
| 16 | $table->increments('id'); |
||
| 17 | $table->string('resource_type')->index(); |
||
| 18 | $table->integer('resource_id')->unsigned()->index(); |
||
| 19 | $table->string('key')->index(); |
||
| 20 | $table->text('value'); |
||
| 21 | $table->timestamps(); |
||
| 22 | |||
| 23 | $table->unique(['resource_type', 'resource_id', 'key']); |
||
| 24 | }); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Reverse the migrations. |
||
| 29 | * |
||
| 30 | * @return void |
||
| 31 | */ |
||
| 32 | public function down() |
||
| 35 | } |
||
| 36 | } |
||
| 37 |