*

dsf

  • *****
  • 261 posts
Re: City/region/country geo database
« Reply #15 on: March 09, 2023, 06:00:03 PM »
@morfik
Just remove your country and import it again in your backoffice.

But removing a country also removes all ads posted.....

*

morfik

  • ****
  • 169 posts
Re: City/region/country geo database
« Reply #16 on: March 09, 2023, 06:07:52 PM »
So how to import this without removing ads?

*

MB Themes

Re: City/region/country geo database
« Reply #17 on: March 09, 2023, 06:17:28 PM »
Drop foreign keys and update, update, update...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

dsf

  • *****
  • 261 posts
Re: City/region/country geo database
« Reply #18 on: March 09, 2023, 06:27:59 PM »
Drop foreign keys and update, update, update...

How to drop them, can you elaborate a little bit? I mean any names? What do we need to drop?

*

morfik

  • ****
  • 169 posts
Re: City/region/country geo database
« Reply #19 on: March 09, 2023, 06:29:00 PM »
I also need more precise instructions. :D

*

morfik

  • ****
  • 169 posts
Re: City/region/country geo database
« Reply #20 on: March 09, 2023, 06:53:04 PM »
Interesting observation.

All pk_i_id in t_region seems to be similar to the previous ones except that they start with different number now. So for instance:

Code: [Select]
(2858791, 'PL', 'Warmia-Masuria', 1, 'warmia-masuria'),
(5337492, 'PL', 'Lower Silesia', 1, 'lower-silesia'),

vs.

Code: [Select]
(3858791, 'PL', 'Warmia-Masuria', 1, 'warmia-masuria'),
(6337492, 'PL', 'Lower Silesia', 1, 'lower-silesia'),

So all the numbers with 2 in the first place, now have 3 in that position. The same with 5 > 6.The rest of the numbers is the same.

Similar with cities, i.e. pk_i_id and fk_i_region_id :

Code: [Select]
(2776808, 2858785, 'PL', 'Abramów', 1, 'abramow', 51.45647, 22.31521),
(5079846, 5337492, 'PL', 'Pasiecznik', 1, 'pasiecznik', 50.9568, 15.57209),

vs.

Code: [Select]
(3776808, 3858785, 'PL', 'Abramów', 1, 'abramow', 51.45647, 22.31521),
(6079846, 6337492, 'PL', 'Pasiecznik', 1, 'pasiecznik', 50.9568, 15.57209),

So why?

I think I could just change (2 > (3 and (5 > (6 , save the file and import it. Older entries would have older IDs. Am I thinking right?

*

morfik

  • ****
  • 169 posts
Re: City/region/country geo database
« Reply #21 on: March 09, 2023, 08:41:28 PM »
I've managed to do it manually via phpmyadmin and couple export/import tables (with changed values). Basically if someone has already published a lot of ads, I don't think there's a way to import the new database. I think in such case, it's better to change the first numbers of the primary i foreign keys and import such database.

I have a question, what's the t_locations_tmp table used for? It looks like it has city keys. But since it's TMP, can it be cleared out safely?

Cron took care of it I suppose. So after updating the database It's nice to run all the cron jobs, to update what should be regenerated.
« Last Edit: March 09, 2023, 10:54:35 PM by morfik »

*

MB Themes

Re: City/region/country geo database
« Reply #22 on: March 10, 2023, 04:42:17 PM »
It's probably used for import
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots