Skip to content

Commit

Permalink
chnage locations table order
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Jul 15, 2024
1 parent a494637 commit 7be2dca
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions database/migrations/2021_04_14_141222_create_locations_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,39 @@
*/
public function up(): void
{
Schema::create('locations', function (Blueprint $table) {
$table->id();
if(!Schema::hasTable('locations')){
Schema::create('locations', function (Blueprint $table) {
$table->id();

//Link To Table
$table->string('model_type')->nullable();
$table->unsignedInteger('model_id')->nullable();
//Link To Table
$table->string('model_type')->nullable();
$table->unsignedInteger('model_id')->nullable();


$table->string('street');
$table->foreignId('area_id')->nullable()->constrained('areas')->onDelete('cascade');
$table->foreignId('city_id')->nullable()->constrained('cities')->onDelete('cascade');
$table->foreignId('country_id')->nullable()->constrained('countries')->onDelete('cascade');
$table->unsignedInteger('home_number')->nullable();
$table->unsignedInteger('flat_number')->nullable();
$table->unsignedInteger('floor_number')->nullable();
$table->string('mark')->nullable();
$table->text('map_url')->nullable();
$table->string('note')->nullable();
$table->string('lat')->nullable();
$table->string('lng')->nullable();
$table->string('zip')->nullable();
$table->boolean('is_main')->default(0)->nullable();
$table->timestamps();
});
$table->string('street');
$table->foreignId('area_id')->nullable()->constrained('areas')->onDelete('cascade');
$table->foreignId('city_id')->nullable()->constrained('cities')->onDelete('cascade');
$table->foreignId('country_id')->nullable()->constrained('countries')->onDelete('cascade');
$table->unsignedInteger('home_number')->nullable();
$table->unsignedInteger('flat_number')->nullable();
$table->unsignedInteger('floor_number')->nullable();
$table->string('mark')->nullable();
$table->text('map_url')->nullable();
$table->string('note')->nullable();
$table->string('lat')->nullable();
$table->string('lng')->nullable();
$table->string('zip')->nullable();
$table->boolean('is_main')->default(0)->nullable();
$table->timestamps();
});
}
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('addresses');
Schema::dropIfExists('locations');
}
};

0 comments on commit 7be2dca

Please sign in to comment.