File: /home/armgroup/libs/database/migrations/2021_05_01_093938_create_addresses_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAddressesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('addresses', function (Blueprint $table) {
$table->id();
$table->foreignId('city_id')->constrained()->onUpdate('cascade')->onDelete('cascade');
$table->string('address', 500);
$table->string('plaque', 10)->nullable();
$table->string('floor', 10)->nullable();
$table->string('postal_code', 10)->nullable();
$table->string('name', 100);
$table->string('mobile', 11);
$table->string('national_code', 10)->nullable();
$table->string('lat', 30)->nullable();
$table->string('lng', 30)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('addresses');
}
}