firstcommit
This commit is contained in:
0
Modules/Destination/database/factories/.gitkeep
Normal file
0
Modules/Destination/database/factories/.gitkeep
Normal file
0
Modules/Destination/database/migrations/.gitkeep
Normal file
0
Modules/Destination/database/migrations/.gitkeep
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('destinations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid();
|
||||
$table->unsignedBigInteger('country_id');
|
||||
$table->string('title');
|
||||
$table->integer('rating');
|
||||
$table->integer('ordering');
|
||||
$table->string('image')->nullable();
|
||||
$table->string('image_path')->nullable();
|
||||
$table->string('status')->default('active');
|
||||
$table->softDeletes();
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('country_id')->references('id')->on('countries');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('destinations');
|
||||
}
|
||||
};
|
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('activity_destination', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('destination_id');
|
||||
$table->unsignedBigInteger('activity_id');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('destination_id')->references('id')->on('destinations');
|
||||
$table->foreign('activity_id')->references('id')->on('activities');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('activity_destination');
|
||||
}
|
||||
};
|
0
Modules/Destination/database/seeders/.gitkeep
Normal file
0
Modules/Destination/database/seeders/.gitkeep
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Destination\database\seeders;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Modules\Activity\app\Models\Activity;
|
||||
use Modules\CountryList\app\Models\Country;
|
||||
use Modules\Destination\app\Models\Destination;
|
||||
|
||||
class DestinationDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user