From a0b40d85dd28d53e16ee69190947df76f77bd833 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 14 Dec 2024 10:19:13 +0330 Subject: [PATCH] create rahdaran table and factory --- app/Models/Rahdaran.php | 14 +++++++++ database/factories/RahdaranFactory.php | 23 +++++++++++++++ ..._090036_add_column_to_azmayeshes_table.php | 1 + ...dd_column_to_road_items_projects_table.php | 1 + ...024_12_11_110000_create_rahdaran_table.php | 29 +++++++++++++++++++ database/seeders/RahdaranSeeder.php | 17 +++++++++++ 6 files changed, 85 insertions(+) create mode 100644 app/Models/Rahdaran.php create mode 100644 database/factories/RahdaranFactory.php create mode 100644 database/migrations/2024_12_11_110000_create_rahdaran_table.php create mode 100644 database/seeders/RahdaranSeeder.php diff --git a/app/Models/Rahdaran.php b/app/Models/Rahdaran.php new file mode 100644 index 00000000..4302de52 --- /dev/null +++ b/app/Models/Rahdaran.php @@ -0,0 +1,14 @@ + + */ +class RahdaranFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + // + ]; + } +} diff --git a/database/migrations/2024_12_02_090036_add_column_to_azmayeshes_table.php b/database/migrations/2024_12_02_090036_add_column_to_azmayeshes_table.php index 10e6fa41..cd07ae30 100644 --- a/database/migrations/2024_12_02_090036_add_column_to_azmayeshes_table.php +++ b/database/migrations/2024_12_02_090036_add_column_to_azmayeshes_table.php @@ -24,6 +24,7 @@ return new class extends Migration public function down(): void { Schema::table('azmayeshes', function (Blueprint $table) { + $table->dropForeign(['user_id']); $table->dropColumn('user_id'); $table->dropColumn('user_name'); }); diff --git a/database/migrations/2024_12_10_093937_add_column_to_road_items_projects_table.php b/database/migrations/2024_12_10_093937_add_column_to_road_items_projects_table.php index f0ddd519..445f8674 100644 --- a/database/migrations/2024_12_10_093937_add_column_to_road_items_projects_table.php +++ b/database/migrations/2024_12_10_093937_add_column_to_road_items_projects_table.php @@ -23,6 +23,7 @@ return new class extends Migration public function down(): void { Schema::table('road_items_projects', function (Blueprint $table) { + $table->dropForeign(['cmms_machine_id']); $table->dropColumn('cmms_machine_id'); $table->dropColumn('cmms_machine_code'); }); diff --git a/database/migrations/2024_12_11_110000_create_rahdaran_table.php b/database/migrations/2024_12_11_110000_create_rahdaran_table.php new file mode 100644 index 00000000..615a1d74 --- /dev/null +++ b/database/migrations/2024_12_11_110000_create_rahdaran_table.php @@ -0,0 +1,29 @@ +id(); + $table->string('name'); + $table->string('code'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('rahdaran'); + } +}; diff --git a/database/seeders/RahdaranSeeder.php b/database/seeders/RahdaranSeeder.php new file mode 100644 index 00000000..4c34c72b --- /dev/null +++ b/database/seeders/RahdaranSeeder.php @@ -0,0 +1,17 @@ +