General Topics > General Discussion

Sudan and South Sudan are two different countries

(1/2) > >>

OneMore:
Just for your info, South Sudan is not the South of the Sudan, but an independant country that is missing in the database  of Abantecart 1.3.4.

I found this when setting delivery locations.

Basara:
Hello.
Thank you for letting us know.  The demo data will be updated in the next version.

OneMore:
Hello,
Thank you.
As in version 1.3.4 the latest country is (242,...,'Kosovo'), I would suggest in next version South Sudan to take id 243 (or greater), so that it does not break relationships based on countries ids of the actual list. That seems to be the way you do things. Thanks.

Basara:

--- Quote from: OneMore on December 13, 2023, 04:44:52 AM ---Hello,
Thank you.
As in version 1.3.4 the latest country is (242,...,'Kosovo'), I would suggest in next version South Sudan to take id 243 (or greater), so that it does not break relationships based on countries ids of the actual list. That seems to be the way you do things. Thanks.

--- End quote ---
Hello. The relationships are not broken if added from admin.
"That seems to be the way you do things." this is how Mysql databases are working. The next ID has come from the database driver and not controlled and should not be by the AbanteCart code.

OneMore:
Yes, relationships are not broken if new countries are added from admin.

But assume that there are new countries, like what happened after Yugoslavia was splitted in several countries.

If new countries are appended at the end of the list in the SQL (like it has been done so far), you just have to have a glance at the INSERT statements for table `ac_countries` from "install/abantecart_database.sql", and insert those countries through the admin (which will autoincrement the ID), or with a few SQL INSERT queries.

Now, assume that new countries that instead of being appended to the list in "install/abantecart_database.sql" would have been alphabetically inserted in it, and ID renumbered accordingly (which would be a "wrong good idea").

In such case, a user that doesn't know if any new country has been added to the list would have to upgrade a few tables with "TRUNCATE ..." SQL queries and reinserting the whole list of countries and regions with ("INSERT INTO ..."). But the IDs of countries would not be same, and if some `zones`and `zones_to_locations`had been defined (for shipping, a.s.o.), those relationships would be broken because the countries would have got different IDs than previously.
In such a case, extensions based on zones would become uncompatible between several AbanteCart versions.

So, in summary, in the installer of any newer version of Abantecart, new countries must simply be apended at the end of the list in "ac_countries" table from "install/abantecart_database.sql".
Countries that previously existed must keep the same ID like they already have  "install/abantecart_database.sql".
This is the way to ensure maximum compatibility among different versions of AbanteCart.


Navigation

[0] Message Index

[#] Next page

Go to full version
Powered by SMFPacks Social Login Mod