Hi all,
Currently i doing a MLM system. Before that, this system is used in 2 country. Even though use same coding but different Database. Right now i need to merging it into a system and a database.
Currently the database is like that....
Same member id was used in 2 different country or Database.
Country A - mb_id 10001
Country B - mb_id 10001
As well as many other tables id was like that.
Before merging, i need a best way to merge it. Hope any experience expert to provide solution.
I have 2 option to do it.
Option 1
1. use country name to create table - like uk_member , my_member ..
2. different country keyin data will record to table depend on country.
3. when doing calculation, will get data from each country table.
Problem : need create many table, not very flexible
Option 2
1. add country field at each table.
2. country code will record to separate member from different country.
3, when doing calculation, only will get data from the related table.
Problem : many record in a table. need to change field type to matching different country member id.
need to edit data for merging.
Any best solution to merge it ??
Thank a lot for reply.
merging 2 database in 2 country
Moderator: General Moderators
I don't know if this would be the best solution, but I would suggest running an update query on each country table, to add a Prefix character to each ID. Same Prefix for all records in one country. So:
Country A: mb_id 10001 becomes A10001
...
Country B: mb_id 10001 becomes B10001
...
If you have foreign keys in related tables, of course you must do the same thing for those fields, too.
Now all ID's are unique and you can merge into one table. That's probably the best schema if people from both countries are accessing the same database. The entity is a person, regardless of what country they live in. You said "many records in a table" -- how many? If it is many millions of records, maybe you have a problem, but if only hundreds of thousands, it shouldn't be a problem.
Country A: mb_id 10001 becomes A10001
...
Country B: mb_id 10001 becomes B10001
...
If you have foreign keys in related tables, of course you must do the same thing for those fields, too.
Now all ID's are unique and you can merge into one table. That's probably the best schema if people from both countries are accessing the same database. The entity is a person, regardless of what country they live in. You said "many records in a table" -- how many? If it is many millions of records, maybe you have a problem, but if only hundreds of thousands, it shouldn't be a problem.
Thanks for reply.
i think that's a more flexible way to do it even it so trouble to do the convert.
Country A: mb_id 10001 becomes A10001
...
Country B: mb_id 10001 becomes B10001
Anyway, the management give me the best answer to do it. Cause the member in one of country was less, so directly give them a new numbering.
Thanks a lot.
i think that's a more flexible way to do it even it so trouble to do the convert.
Country A: mb_id 10001 becomes A10001
...
Country B: mb_id 10001 becomes B10001
Anyway, the management give me the best answer to do it. Cause the member in one of country was less, so directly give them a new numbering.
Thanks a lot.