OK, so what does your code look like? Why can't you preserve the id's?

Anthony

On Monday, October 10, 2016 at 9:43:50 AM UTC-4, 
luis.vallada...@metamaxzone.com wrote:
>
> I thin that method doesnt work for me, let me explain better what i want 
> to do:
>
> 6 months ago i released a production APP, now we will launch the second 
> version of this app and there are several (big) differences between the 
> database structure in production and the one i will deploy now, but i dont 
> want to lose all the data collected in production, so what i want to do can 
> be resumed in 3 steps:
>
> 1. Get all the information from the production database with the OLD 
> structure
> 2. Format this information to the NEW structure (some fields will be 
> deleted, other will be added... there are several changes)
> 3. Insert this data in the NEW structure database.
>
> Also, this app is created with a microservices architecture which means 
> that i dont have only one database, instead i've 14 database that have 
> cross data between them (i mean, the id stored for a user in the users 
> database are also used in several other databases as reference to the user)
>
> So because this if i change the ids i will need to make a big coherence 
> check around my 14 databases, with (approximately) 10 tables each one, this 
> is a big deal as you can see.
>
> Thanks a lot for the help and i hope you can keep helping me.
>
> El jueves, 6 de octubre de 2016, 14:19:49 (UTC-4), Anthony escribió:
>>
>> Do you really need the id's to remain the same? Note, if you use this 
>> method 
>> <http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#CSV--all-tables-at-once->
>>  
>> to migrate, web2py will automatically update any reference fields so they 
>> contain the new ids of referenced records.
>>
>> Anthony
>>
>> On Wednesday, October 5, 2016 at 5:47:36 PM UTC-4, 
>> argenio...@metamaxzone.com wrote:
>>>
>>> I'm doing a migrate data of 2 databases with diferents tables.
>>>
>>> My only problems is with ids! 
>>>
>>> table 1
>>> id: 5, name: Diana
>>> id: 8, name: Carlos
>>>
>>>
>>> when i migrate this data to databases 2
>>> id: 1, name: Diana
>>> id: 2, name: Carlos
>>>
>>> Look the id's not the same.
>>>
>>> what is the method to save the same id?
>>> I read about primarekey parameters but dont work.
>>>
>>> The process of migrate if a script with 2 Pydal, one for the old 
>>> database and other for new databases.
>>> I execute one select() of everithing (not much data), later convert to 
>>> the new structure and all work perfectly. the only problem is with ID .
>>>
>>> Please help me, thanks.
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to