Differential D2674 Diff 7990 src/database/migrations/2021_05_05_134357_create_companion_apps_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2021_05_05_134357_create_companion_apps_table.php
- This file was added.
<?php | |||||
use Illuminate\Database\Migrations\Migration; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Support\Facades\Schema; | |||||
// phpcs:ignore | |||||
class CreateCompanionAppsTable extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::create('companion_apps', function (Blueprint $table) { | |||||
$table->bigIncrements('id'); | |||||
$table->bigInteger('user_id'); | |||||
// Seems to grow over time, no clear specification. | |||||
machniak: Redundant index(). I see we don't do this in other tables with the foreign key. I guess it's… | |||||
// Typically below 200 bytes, but some mention up to 350 bytes. | |||||
Done Inline ActionsThis line exceeds 120 characters limit machniak: This line exceeds 120 characters limit | |||||
$table->string('notification_token', 512)->nullable(); | |||||
// 16 byte for android, 36 for ios. May change over tyme | |||||
$table->string('device_id', 64); | |||||
$table->string('name')->nullable(); | |||||
$table->boolean('mfa_enabled'); | |||||
$table->timestamps(); | |||||
$table->foreign('user_id') | |||||
->references('id')->on('users') | |||||
->onDelete('cascade') | |||||
->onUpdate('cascade'); | |||||
}); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::dropIfExists('companion_apps'); | |||||
} | |||||
} |
Redundant index(). I see we don't do this in other tables with the foreign key. I guess it's created automatically by mysql.