Files
backend/database/migrations/2013_10_12_100000_create_cities_table.php
2024-02-01 09:53:53 +00:00

42 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCitiesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cities', function (Blueprint $table) {
$table->smallIncrements('id');
$table->unsignedTinyInteger('province_id');
$table->foreign('province_id')
->references('id')
->on('provinces');
$table->string('name_fa');
$table->string('name_en')->nullable();
$table->unsignedSmallInteger('feature_id')->nullable();
$table->unsignedTinyInteger('province_feature_id')->nullable();
$table->decimal('center_lat', 12, 10)->nullable();
$table->decimal('center_long', 12, 10)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cities');
}
}