From 0573f5acc807604a1213621f00de252b6cb72103 Mon Sep 17 00:00:00 2001 From: merdan Date: Thu, 24 Feb 2022 17:21:44 +0500 Subject: [PATCH] states --- ...ght_price_to_marketplace_sellers_table.php | 32 ------------------- .../Sarga/Shop/src/Data/countries_ru.json | 5 +-- .../Sarga/Shop/src/Data/countries_tm.json | 4 --- ...eeder.php => CountryStatesTableSeeder.php} | 5 ++- .../src/Database/Seeders/DatabaseSeeder.php | 2 +- 5 files changed, 6 insertions(+), 42 deletions(-) delete mode 100644 packages/Sarga/Admin/src/Database/Migrations/2022_02_22_212835_add_weight_price_to_marketplace_sellers_table.php rename packages/Sarga/Shop/src/Database/Seeders/{CountriesTableSeeder.php => CountryStatesTableSeeder.php} (59%) diff --git a/packages/Sarga/Admin/src/Database/Migrations/2022_02_22_212835_add_weight_price_to_marketplace_sellers_table.php b/packages/Sarga/Admin/src/Database/Migrations/2022_02_22_212835_add_weight_price_to_marketplace_sellers_table.php deleted file mode 100644 index 75f254822..000000000 --- a/packages/Sarga/Admin/src/Database/Migrations/2022_02_22_212835_add_weight_price_to_marketplace_sellers_table.php +++ /dev/null @@ -1,32 +0,0 @@ -decimal('weight_price')->unsigned()->default(0); - - }); - } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('categories', function (Blueprint $table) { - $table->dropColumn('weight_price'); - }); - } -} diff --git a/packages/Sarga/Shop/src/Data/countries_ru.json b/packages/Sarga/Shop/src/Data/countries_ru.json index efecd413f..113c6493c 100644 --- a/packages/Sarga/Shop/src/Data/countries_ru.json +++ b/packages/Sarga/Shop/src/Data/countries_ru.json @@ -1,10 +1,7 @@ [ + { "country_id":1, - "name":"Турция" - }, - { - "country_id":2, "name":"Туркменистан" } ] \ No newline at end of file diff --git a/packages/Sarga/Shop/src/Data/countries_tm.json b/packages/Sarga/Shop/src/Data/countries_tm.json index 83a5114df..18d151506 100644 --- a/packages/Sarga/Shop/src/Data/countries_tm.json +++ b/packages/Sarga/Shop/src/Data/countries_tm.json @@ -1,10 +1,6 @@ [ { "country_id":1, - "name":"Turkiýa" - }, - { - "country_id":2, "name":"Türkmenistan" } ] \ No newline at end of file diff --git a/packages/Sarga/Shop/src/Database/Seeders/CountriesTableSeeder.php b/packages/Sarga/Shop/src/Database/Seeders/CountryStatesTableSeeder.php similarity index 59% rename from packages/Sarga/Shop/src/Database/Seeders/CountriesTableSeeder.php rename to packages/Sarga/Shop/src/Database/Seeders/CountryStatesTableSeeder.php index 18d7c6af8..16df0a48c 100644 --- a/packages/Sarga/Shop/src/Database/Seeders/CountriesTableSeeder.php +++ b/packages/Sarga/Shop/src/Database/Seeders/CountryStatesTableSeeder.php @@ -5,14 +5,17 @@ namespace Sarga\Shop\Database\Seeders; use Illuminate\Support\Facades\DB; use Illuminate\Database\Seeder; -class CountriesTableSeeder extends Seeder +class CountryStatesTableSeeder extends Seeder { public function run() { DB::table('countries')->delete(); + DB::table('country_states')->delete(); $countries = json_decode(file_get_contents(__DIR__ . '/../../Data/countries.json'), true); + $states = json_decode(file_get_contents(__DIR__ . '/../../Data/states.json'), true); DB::table('countries')->insert($countries); + DB::table('country_states')->insert($states); } } \ No newline at end of file diff --git a/packages/Sarga/Shop/src/Database/Seeders/DatabaseSeeder.php b/packages/Sarga/Shop/src/Database/Seeders/DatabaseSeeder.php index 8a2bdd012..dbb628552 100644 --- a/packages/Sarga/Shop/src/Database/Seeders/DatabaseSeeder.php +++ b/packages/Sarga/Shop/src/Database/Seeders/DatabaseSeeder.php @@ -16,7 +16,7 @@ class DatabaseSeeder extends Seeder $this->call(SLocalesTableSeeder::class); $this->call(SCurrencyTableSeeder::class); $this->call(ChannelTableSeeder::class); - $this->call(CountriesTableSeeder::class); + $this->call(CountryStatesTableSeeder::class); $this->call(StatesTableSeeder::class); $this->call(CountryStateTranslationSeeder::class);