| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('friendships', function (Blueprint $table) { |
||
| 17 | $table->increments('id'); |
||
| 18 | $table->unsignedInteger('user_id'); |
||
| 19 | $table->unsignedInteger('friend_id'); |
||
| 20 | $table->boolean('status')->default(0); |
||
| 21 | $table->timestamps(); |
||
| 22 | |||
| 23 | $table->unique(['user_id', 'friend_id']); |
||
| 24 | |||
| 25 | $table->foreign('user_id') |
||
| 26 | ->references('id')->on(config('friendships.users_table')) |
||
| 27 | ->onUpdate('cascade') |
||
| 28 | ->onDelete('cascade'); |
||
| 29 | |||
| 30 | $table->foreign('friend_id') |
||
| 31 | ->references('id')->on(config('friendships.users_table')) |
||
| 32 | ->onUpdate('cascade') |
||
| 33 | ->onDelete('cascade'); |
||
| 34 | }); |
||
| 35 | } |
||
| 36 | |||
| 47 |