Database source control with Oracle

前端 未结 9 2085
天命终不由人
天命终不由人 2021-02-04 08:14

I have been looking during hours for a way to check in a database into source control. My first idea was a program for calculating database diffs and ask all the developers to i

9条回答
  •  后悔当初
    2021-02-04 08:53

    It may not be as slick as detecting the diffs, however we use a simple ant build file. In our current CVS branch, we'll have the "base" database code broken out into the ddl for tables and triggers and such. We'll also have the delta folder, broken out in the same manner. Starting from scratch, you can run "base" + "delta" and get the current state of the database. When you go to production, you'll simply run the "delta" build and be done. This model doesn't work uber-well if you have a huge schema and you are changing it rapidly. (Note: At least among database objects like tables, indexes and the like. For packages, procedures, functions and triggers, it works well.) Here is a sample ant task:

        
    
        
            
        
    
    
    

提交回复
热议问题