Support Forums - Classified Ads Script Osclass

General osclass questions => Feature request => Topic started by: Oleksandr Kravchuk on February 09, 2025, 11:24:55 PM

Title: Simplify adding of cities, regions and countries
Post by: Oleksandr Kravchuk on February 09, 2025, 11:24:55 PM
Process of adding of cities, regions and countries needs to be simplified. Import SQL file with easy structure.
Title: Re: Simplify adding of cities, regions and counries
Post by: MB Themes on February 10, 2025, 06:48:13 AM
Osclass already support importing data via sql, structure is based on table structure
Title: Re: Simplify adding of cities, regions and countries
Post by: Oleksandr Kravchuk on February 10, 2025, 10:53:51 AM
I get error when I add "s_name_native".
Title: Re: Simplify adding of cities, regions and countries
Post by: MB Themes on February 12, 2025, 02:58:57 PM
You have it in data?
You will need to provide much more details than you did...
Title: Re: Simplify adding of cities, regions and countries
Post by: Oleksandr Kravchuk on February 13, 2025, 09:02:01 PM
REPLACE INTO /*TABLE_PREFIX*/t_country (pk_c_code, s_name, s_name_native, s_slug, s_phone_code, s_currency) VALUES
('UA', 'Ukraine', 'Україна', 'ukraine', '380', 'UAH');

REPLACE INTO /*TABLE_PREFIX*/t_region (pk_i_id, fk_c_country_code, s_name, s_name_native, b_active, s_slug) VALUES
(3686966, 'UA', 'Zhytomyr Obl.', 'Житомирська обл.', 1, 'zhytomyr-obl'),

REPLACE INTO /*TABLE_PREFIX*/t_city (pk_i_id, fk_i_region_id, fk_c_country_code, s_name, s_name_native, b_active, s_slug, d_coord_lat, d_coord_long) VALUES
(3686967, 3686966, 'UA', 'Zhytomyr', 'Житомир', 1, 'zhytomyr', 50.26487, 28.67669),

Osclass understand s_name_native in t_country, but not in t_region and t_city.
Title: Re: Simplify adding of cities, regions and countries
Post by: MB Themes on February 14, 2025, 12:38:28 PM
Then you probably do not have it in table definitions.
Title: Re: Simplify adding of cities, regions and countries
Post by: Oleksandr Kravchuk on March 18, 2025, 10:11:55 PM
Please, fix this. Also when I upload SQL file all listings are deleting. Can you make listings to stay?
Title: Re: Simplify adding of cities, regions and countries
Post by: MB Themes on March 19, 2025, 11:42:47 AM
Fix what?
In osclass struct.sql it exists, fix it on your installation.
Title: Re: Simplify adding of cities, regions and countries
Post by: Oleksandr Kravchuk on March 19, 2025, 06:00:24 PM
I have tried 2 times, it gives an error. And deletes all listings.
Title: Re: Simplify adding of cities, regions and countries
Post by: MB Themes on March 22, 2025, 08:14:22 AM
Check your database structure - items, regions, cities - and make sure it match to struct.sql