Total Complexity | 2 |
Total Lines | 17 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class AddForeignKeysToEditedMessageTable extends Migration |
||
10 | { |
||
11 | public function up(): void |
||
12 | { |
||
13 | Schema::table('edited_message', static function (Blueprint $table) { |
||
14 | $table->foreign('chat_id', 'edited_message_ibfk_1')->references('id')->on('chat')->onUpdate('RESTRICT')->onDelete('RESTRICT'); |
||
15 | $table->foreign('chat_id', 'edited_message_ibfk_2')->references('chat_id')->on('message')->onUpdate('RESTRICT')->onDelete('RESTRICT'); |
||
16 | $table->foreign('user_id', 'edited_message_ibfk_3')->references('id')->on('user')->onUpdate('RESTRICT')->onDelete('RESTRICT'); |
||
17 | }); |
||
18 | } |
||
19 | |||
20 | public function down(): void |
||
26 | }); |
||
27 | } |
||
29 |