41 lines
1,007 B
PHP
41 lines
1,007 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
|
||
|
class FixMailBug extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
|
||
|
Schema::table("mails", function(Blueprint $table) {
|
||
|
// e.g. $table->dropUnique('email');
|
||
|
$table->dropForeign('mails_user_id_foreign');
|
||
|
$table->dropUnique('unique_primary_email');
|
||
|
$table->foreign('user_id')->references('id')->on('users');
|
||
|
});
|
||
|
|
||
|
Schema::table("users", function(Blueprint $table) {
|
||
|
// e.g. $table->dropUnique('email');
|
||
|
$table->string('inviteCode')->nullable()->default(null)->comment("Invite code user used to register");
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
return false;
|
||
|
// Vorwärts immer, rückwerts nimmer
|
||
|
}
|
||
|
}
|