Merge branch 'update-v2' of https://voight001.lesidc.com/mesbr-app into update-v2
This commit is contained in:
commit
83f68ca14f
34 changed files with 729 additions and 0 deletions
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldCalendrierTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
DB::table('migrations')->truncate();
|
||||
Schema::create('calendrier', function (Blueprint $table) {
|
||||
$table->id('calendrier_id');
|
||||
|
||||
$table->bigInteger('calendrier_couponId')->default(0);
|
||||
|
||||
$table->timestamp('calendrier_startdate')->useCurrent();
|
||||
$table->timestamp('calendrier_enddate')->useCurrent()->useCurrentOnUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('calendrier');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldCampagneTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('campagne', function (Blueprint $table) {
|
||||
$table->id('camp_id');
|
||||
|
||||
$table->string('camp_name', 500)->default('');
|
||||
$table->unsignedTinyInteger('camp_type')->default(0)
|
||||
->comment('0 = mur; 1 = panier; 2 = mur sous forme de panier');
|
||||
$table->smallInteger('camp_limitedPrinting')->default(0)
|
||||
->comment('Limite l\'impression des paniers à un BR à la fois');
|
||||
$table->smallInteger('camp_published')->default(1);
|
||||
|
||||
$table->string('camp_siteId', 50);
|
||||
|
||||
$table->timestamp('camp_createdate')->useCurrent();
|
||||
$table->timestamp('camp_updatedate')->useCurrent()->useCurrentOnUpdate();
|
||||
$table->timestamp('camp_deleted_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('campagne');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldContactTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('contact', function (Blueprint $table) {
|
||||
$table->id('contact_id');
|
||||
|
||||
$table->string('contact_ref', 200)->default(''); // broken key
|
||||
$table->string('contact_prenom', 200)->default('');
|
||||
$table->string('contact_nom', 200)->default('');
|
||||
$table->string('contact_email', 200)->default(''); // broken key
|
||||
$table->string('contact_cp', 50)->default('');
|
||||
$table->string('contact_ville', 200)->default('');
|
||||
|
||||
$table->smallInteger('contact_country')->default(250);
|
||||
$table->string('contact_hash', 50)->nullable();
|
||||
|
||||
$table->string('contact_siteId', 50);
|
||||
|
||||
$table->timestamp('contact_createdate')->useCurrent();
|
||||
$table->timestamp('contact_updatedate')->useCurrent()->useCurrentOnUpdate();
|
||||
|
||||
// me demandez pas pourquoi iso prod (-_-")
|
||||
$table->index(['contact_ref', 'contact_email'], 'contact_ref');
|
||||
$table->index(['contact_email', 'contact_ref'], 'contact_email');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('contact');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldCouponTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('coupon', function (Blueprint $table) {
|
||||
$table->id('coupon_id');
|
||||
|
||||
$table->string('coupon_code', 50);
|
||||
$table->string('coupon_gs1code', 500);
|
||||
$table->string('coupon_name', 500);
|
||||
$table->float('coupon_value', 0);
|
||||
|
||||
$table->string('coupon_thumbnail1', 500);
|
||||
$table->string('coupon_thumbnail2', 500);
|
||||
$table->string('coupon_thumbnail3', 500);
|
||||
$table->string('coupon_thumbnail4', 500);
|
||||
$table->string('coupon_image', 500);
|
||||
|
||||
$table->integer('coupon_enablelimitquantity')->default(0);
|
||||
$table->integer('coupon_limitquantity')->default(1);
|
||||
$table->integer('coupon_enablelimitperiod')->default(1);
|
||||
$table->integer('coupon_limitperiod')->default(0);
|
||||
$table->integer('coupon_validity')->default(30);
|
||||
|
||||
$table->date('coupon_mindatediffusion')->nullable();
|
||||
$table->date('coupon_maxdatediffusion')->nullable();
|
||||
$table->date('coupon_maxdatevalidity')->nullable();
|
||||
|
||||
$table->unsignedTinyInteger('coupon_norme')->default(0)
|
||||
->comment('0 = par défaut; 1 = Benelux');
|
||||
$table->integer('coupon_published')->default(1);
|
||||
|
||||
$table->string('coupon_decoration_image', 500)->nullable();
|
||||
$table->string('coupon_logo_image', 500)->nullable();
|
||||
$table->string('coupon_validity_text', 500)->nullable();
|
||||
$table->string('coupon_rcs', 500)->nullable();
|
||||
$table->string('coupon_legal_mentions', 1000)->nullable();
|
||||
|
||||
$table->tinyInteger('coupon_legal_mentions_splitted')->default(0);
|
||||
|
||||
$table->string('coupon_site_contact', 500)->nullable();
|
||||
|
||||
$table->unsignedInteger('coupon_seuil_alert')->default(100);
|
||||
$table->integer('coupon_treatment_center')->default(0);
|
||||
|
||||
$table->bigInteger('coupon_siteId');
|
||||
|
||||
$table->timestamp('coupon_createdate')->useCurrent();
|
||||
$table->timestamp('coupon_updatedate')->useCurrent()->useCurrentOnUpdate();
|
||||
$table->timestamp('coupon_deleted_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('coupon');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldCampagneCouponTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('campagne_coupon', function (Blueprint $table) {
|
||||
$table->foreignId('campagne_id');
|
||||
$table->foreign('campagne_id')->references('camp_id')->on('campagne')->cascadeOnDelete();
|
||||
$table->foreignId('coup_id');
|
||||
$table->foreign('coup_id')->references('coupon_id')->on('coupon')->cascadeOnDelete();
|
||||
$table->unique(['campagne_id', 'coup_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('campagne_coupon');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldCustomersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('customers', function (Blueprint $table) {
|
||||
$table->id(); // TODO remove this in the future
|
||||
|
||||
$table->string('hashcode', 36)->unique();
|
||||
$table->string('email', 255)->unique();
|
||||
$table->integer('country')->default(250);
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('customers');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldLogsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->tinyInteger('log_action');
|
||||
$table->string('log_source', 255);
|
||||
|
||||
$table->text('log_params')->nullable();
|
||||
$table->string('log_statut');
|
||||
$table->text('log_message');
|
||||
|
||||
$table->string('log_refsite', 255)->nullable();
|
||||
$table->bigInteger('log_contactId')->nullable();
|
||||
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('logs');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldMouvementTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('mouvement', function (Blueprint $table) {
|
||||
$table->id('mouvement_id');
|
||||
|
||||
$table->unsignedInteger('mouvement_couponId');
|
||||
$table->integer('mouvement_nombre');
|
||||
$table->string('mouvement_commentaire')->nullable();
|
||||
|
||||
$table->timestamp('mouvement_created_at')->useCurrent()->useCurrentOnUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('mouvement');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldMurTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('mur', function (Blueprint $table) {
|
||||
$table->id('mur_id');
|
||||
|
||||
$table->integer('mur_campId'); // broken foreign key
|
||||
$table->integer('mur_contactId'); // broken foreign key
|
||||
$table->integer('mur_couponId'); // broken foreign key
|
||||
|
||||
$table->boolean('mur_deleted')->default(false);
|
||||
|
||||
$table->timestamp('mur_createdate')->useCurrent();
|
||||
|
||||
// me demandez pas pourquoi iso prod (-_-")
|
||||
$table->index(['mur_campId'], 'FK_mur_campagne');
|
||||
$table->index(['mur_contactId'], 'mur_contactId');
|
||||
$table->index(['mur_couponId'], 'mur_couponId');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('mur');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldNotificationTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('old_notification', function (Blueprint $table) {
|
||||
$table->id('notif_id');
|
||||
|
||||
$table->string('notif_email')->default('');
|
||||
$table->string('notif_name')->nullable();
|
||||
|
||||
$table->integer('notif_campId');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('old_notification');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldPanierTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('old_panier', function (Blueprint $table) {
|
||||
$table->id('panier_id');
|
||||
|
||||
$table->string('panier_ref', 100)->default('');
|
||||
|
||||
$table->boolean('panier_pending')
|
||||
->comment('1 = en cours; 0 = terminé');
|
||||
|
||||
$table->integer('panier_campId');
|
||||
$table->integer('panier_contactId');
|
||||
|
||||
$table->timestamp('panier_createdate')->useCurrent();
|
||||
$table->timestamp('panier_updatedate')->useCurrent()->useCurrentOnUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('old_panier');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldPanierContentTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('panier_content', function (Blueprint $table) {
|
||||
$table->id('panier_content_id');
|
||||
|
||||
$table->integer('panier_content_quantity')->default(0);
|
||||
$table->integer('panier_content_printed')->default(0);
|
||||
|
||||
$table->integer('panier_content_panierId')->default(0);
|
||||
$table->integer('panier_content_couponId');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('panier_content');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldPasswordResetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
|
||||
$table->string('email')->index('password_resets_email_index');
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldPrintedWallsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('printed_walls', function (Blueprint $table) {
|
||||
$table->bigInteger('camp_id');
|
||||
$table->bigInteger('coupon_id');
|
||||
$table->bigInteger('customer_id');
|
||||
|
||||
// me demandez pas pourquoi iso prod (-_-")
|
||||
$table->index('camp_id', 'FK_printed_wall_campagne');
|
||||
$table->index('coupon_id', 'FK_printed_wall_coupon');
|
||||
$table->index('customer_id', 'FK_printed_wall_customers');
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('printed_walls');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldSiteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('site', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('site_nom', 200)->default('');
|
||||
$table->string('site_logo', 500)->default('');
|
||||
$table->string('site_contact', 500)->default('');
|
||||
$table->string('site_rcs', 100)->nullable();
|
||||
$table->string('site_libelle', 200)->nullable();
|
||||
$table->string('crm_token')->nullable();
|
||||
$table->string('crm_password')->nullable();
|
||||
|
||||
$table->string('site_id', 50);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('site');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldStatistiquesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('statistiques', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->integer('stat_couponPrinted');
|
||||
|
||||
$table->integer('stat_campId');
|
||||
$table->integer('stat_couponId');
|
||||
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('statistiques');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldUsersTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('email');
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password');
|
||||
$table->rememberToken();
|
||||
|
||||
$table->string('roles', 50);
|
||||
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateOldSiteUserTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('site_user', function (Blueprint $table) {
|
||||
$table->foreignId('user_id');
|
||||
$table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
|
||||
$table->foreignId('site_id');
|
||||
$table->foreign('site_id')->references('id')->on('site')->cascadeOnDelete();
|
||||
$table->unique(['user_id', 'site_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('site_user');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue