LP53-Services-BD-CMS/database/migrations/2023_02_17_160206_clients.php

38 lines
890 B
PHP
Raw Normal View History

2023-03-03 13:45:51 +01:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Query\Expression;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
2023-03-03 15:43:38 +01:00
Schema::create('clients', function (Blueprint $table){
2023-03-03 13:45:51 +01:00
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->string('nom')->nullable();
2023-03-03 15:43:38 +01:00
$table->string("prenom")->nullable();
$table->json("adresse")->default(new Expression('(JSON_OBJECT())'));
2023-03-03 13:45:51 +01:00
$table->timestamps();
$table->index("nom");
$table->index("prenom");
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
2023-03-03 15:43:38 +01:00
Schema::dropIfExists('clients');
2023-03-03 13:45:51 +01:00
}
};