Drop the unicity constraint on Customer emails
This commit is contained in:
parent
9af30eef63
commit
3a6de55d19
1 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class DropUnicityFromCustomerEmails extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
Schema::table('emails', function (Blueprint $table) {
|
||||||
|
$table->dropUnique(['email']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::table('emails', function (Blueprint $table) {
|
||||||
|
// TODO: Remove all duplicated e-mails.
|
||||||
|
$table->unique('email');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue