My notes below:

On Friday, November 27, 2015 at 11:35:44 AM UTC-8, Antonio Salazar wrote:
>
> My projects are small enough that I can consider switching from migrated 
> to legacy databases. I feared I was overlooking something, but it really 
> seems like migrations, in some cases, will just shift the workload 
> elsewhere.
>
>  [...]

On Friday, November 27, 2015 at 12:53:57 PM UTC-6, Richard wrote:
>
> Hello Antonio, 
>
> This is a vast subject... And all suggestions couldn't apply or you will 
> not agree with all... But here a couple of them :
>
[...] 

> [If you have a good ETL manipulating routine defined, you can create new 
> DB instead of modifiying the same DB... So you can name your DB with the 
> version of you app so you know that these DB schema is the same of the app 
> dal model. Then you adapt you ETL migration routine and you insert your 
> data into the refactored (or new) DB schema... If you only have testing 
> data set to manage, you can also, have these data created by your app with 
> a fixutre of this type :
>
> [...] 

> NOTE : ETL = Extract - Transform = Load
>
>
<URL:https://en.wikipedia.org/wiki/Extract,_transform,_load>

For many of us, Extract and Load can be handled either in the DB console or 
even (within web2py) by CSV export/import.  Especially for a dev database.  
Since none of my dev DBs need to track anything like live data, just 
deleting the old DB and importing the new one gives me sufficient  ETL to 
play around.  This is also how I back up my databases.

Another thing to consider when working on old code after working on new 
code is to have a dev environment on a virtual machine (Box, or the home 
user version of VMware would cover my needs).  With Mercurial or Git (or 
even SVN) there is no particular problem with your working dirs being on 
different machines, so the VM shouldn't interfere with your code version 
control.

If you have a lot of tables, though, or a lot of data, an ETL vendor might 
be helpful.  I don't know how big or how complicated you need to be to 
reach that level.  I'm nowhere close, but perhaps Niphlod or Anthony have 
some insights.


/dps

 

> On Fri, Nov 27, 2015 at 12:52 PM, Antonio Salazar <asala...@gmail.com> 
> wrote:
>
>> What are the best practices (or personal experiences) when dealing with 
>> database migrations and source control versioning?
>>
>> I think database migration is one of the strong points of web2py, but 
>> what about migrations caused by checking out different branches?
>>
>> Example:
>>
>>    - Version A is in production
>>    - Version B creates a new field in an existing table, in development
>>    
>> User reports problem in version A. When switching from version C to 
>> version A, the new field is dropped from the database and its content is 
>> lost.
>>
>  

-- 
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