Differential D2428 Diff 7006 src/database/migrations/2021_03_26_080000_create_signup_invitations_table.php
Changeset View
Changeset View
Standalone View
Standalone View
src/database/migrations/2021_03_26_080000_create_signup_invitations_table.php
- This file was added.
<?php | |||||
use Illuminate\Support\Facades\Schema; | |||||
use Illuminate\Database\Schema\Blueprint; | |||||
use Illuminate\Database\Migrations\Migration; | |||||
// phpcs:ignore | |||||
class CreateSignupInvitationsTable extends Migration | |||||
{ | |||||
/** | |||||
* Run the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function up() | |||||
{ | |||||
Schema::create( | |||||
'signup_invitations', | |||||
function (Blueprint $table) { | |||||
$table->string('id', 36); | |||||
$table->string('email'); | |||||
mollekopf: Is there a reason for not using uuid('id'); ? | |||||
Done Inline ActionsI guess we just didn't know it existed ;) Maybe Jeroen would know. machniak: I guess we just didn't know it existed ;) Maybe Jeroen would know. | |||||
$table->smallInteger('status'); | |||||
$table->bigInteger('user_id')->nullable(); | |||||
$table->bigInteger('tenant_id')->unsigned()->nullable(); | |||||
Done Inline ActionsRemove? mollekopf: Remove? | |||||
$table->timestamps(); | |||||
$table->primary('id'); | |||||
$table->index('email'); | |||||
$table->index('created_at'); | |||||
$table->foreign('tenant_id')->references('id')->on('tenants') | |||||
Not Done Inline ActionsAre we using this index? InvitationsController::index does not seem to use status (but created_at) mollekopf: Are we using this index?
InvitationsController::index does not seem to use status (but… | |||||
Done Inline ActionsRemoved. I was just anticipating a future use. machniak: Removed. I was just anticipating a future use. | |||||
->onUpdate('cascade')->onDelete('set null'); | |||||
$table->foreign('user_id')->references('id')->on('users') | |||||
->onUpdate('cascade')->onDelete('set null'); | |||||
} | |||||
); | |||||
} | |||||
/** | |||||
* Reverse the migrations. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function down() | |||||
{ | |||||
Schema::dropIfExists('signup_invitations'); | |||||
} | |||||
} |
Is there a reason for not using uuid('id'); ?