| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('files', function (Blueprint $table) { |
||
| 17 | $table->increments('id')->unsigned(); |
||
| 18 | $table->timestamps(); |
||
| 19 | $table->softDeletes(); |
||
| 20 | $table->string('uuid'); |
||
| 21 | $table->string('filename')->nullable(); |
||
| 22 | $table->integer('size')->unsigned(); |
||
| 23 | }); |
||
| 24 | |||
| 25 | Schema::create('fileables', function (Blueprint $table) { |
||
| 26 | $table->increments('id'); |
||
| 27 | $table->timestamps(); |
||
| 28 | $table->softDeletes(); |
||
| 29 | $table->integer('file_id')->unsigned(); |
||
| 30 | $table->foreign('file_id', 'fk_files_file_id')->references('id')->on('files')->onDelete('cascade')->onUpdate('cascade'); |
||
| 31 | $table->integer('fileable_id')->nullable()->unsigned(); |
||
| 32 | $table->string('fileable_type')->nullable(); |
||
| 33 | $table->string('role')->nullable(); |
||
| 34 | $table->string('locale', 6)->index(); |
||
| 35 | $table->index(['fileable_type', 'fileable_id']); |
||
| 36 | }); |
||
| 50 |