You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Vít Procházka <vi...@atlas.cz> on 2016/03/26 11:45:21 UTC

SVN v(+) database versioning question

Hello,

may I ask a question: what would be the best way to achieve this with SVN:

Database versioning scripts shall be (1) numbered (due to DBmaintain)  
and (2) incremental.

ad 1) When a developer commits a script, I should get the next higher number
than the last committed script. E.g. 045_customers.SQL, 046_orders.SQL etc

ad 2) Scripts, which are once committed, should be immutable -- developers
should not be able to change them. They can only add new scripts.

Many thanks in advance,
V. Prochazka


Re: SVN v(+) database versioning question

Posted by Stefan Hett <st...@egosoft.com>.
Hi Vit,
> Hello,
>
> may I ask a question: what would be the best way to achieve this with 
> SVN:
>
> Database versioning scripts shall be (1) numbered (due to DBmaintain)  
> and (2) incremental.
>
> ad 1) When a developer commits a script, I should get the next higher 
> number
> than the last committed script. E.g. 045_customers.SQL, 046_orders.SQL 
> etc
>
> ad 2) Scripts, which are once committed, should be immutable -- 
> developers
> should not be able to change them. They can only add new scripts.
>
> Many thanks in advance,
> V. Prochazka
Both should be achievable using pre-commit hooks. You can add a check to 
ensure consecutive numbering of your SQL-script files as well as 
preventing any modifications to committed files.

-- 
Regards,
Stefan Hett