Drop the unicity constraint on Customer emails

This commit is contained in:
Antoine Le Gonidec 2024-07-09 14:18:56 +02:00
parent 9af30eef63
commit 3a6de55d19
Signed by: vv221
GPG key ID: 636B78F91CEB80D8

View file

@ -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');
});
}
}