Sync Sql Script numbers between developers / teams

46 views
Skip to first unread message

Carlos Campos

unread,
Dec 13, 2018, 11:11:09 AM12/13/18
to DbUp Discuss
Hi all,

We have a problem with the naming of the sql scripts.

If someone starts a long branch for example and uses Script0004 and the branch has a long life, then before this is committed to master someone else creates another branch and also takes Script0004 then this creates overlapping script numbers.

What is worse is that git wont alert us to conflicts because the file names do not colide:
  • Script0004 - add feature Foo.sql
  • Script0004 - fix indexing on Bar.sql

I'm surprised I can't find anything regarding this issue.
How do people solved this?

We could have a naming convention say, use only nymber.sql as the filename: "0004.sql" and that will have git provide conflicts.
But this does not prevent anyone making a mistake or not following the naming convention -- no conflict -- and errors can pass easily because there will be no build failures.

Cheers,
Carlos

Darrell Tunnell

unread,
Dec 13, 2018, 12:44:40 PM12/13/18
to dbup-d...@googlegroups.com
If those two files touch unrelated areas of the database then there is no problem? The problem comes if those sql scripts in anyway interfere or overlap with eachother. One place to catch problems like that is to retest your feature branch after forward integrating it with latest changes on develop prior to merging it back. You can fix problems in your scenario on the second feature branch prior to merging it..


From: dbup-d...@googlegroups.com <dbup-d...@googlegroups.com> on behalf of Carlos Campos <vet...@gmail.com>
Sent: Thursday, December 13, 2018 4:11:09 PM
To: DbUp Discuss
Subject: Sync Sql Script numbers between developers / teams
 
--
You received this message because you are subscribed to the Google Groups "DbUp Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbup-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Casper Schmidt

unread,
Dec 13, 2018, 1:21:15 PM12/13/18
to dbup-d...@googlegroups.com
Hi

I use a convention based on dates ie. 2018-12-03 as the prefix and then possibly either initials of the comitter or an increasing number if more scripts share the same date. Just before merging a feature back to develop any scripts should be renamed to the current date after merging develop into the branch and testing everything still works

/Casper 
Reply all
Reply to author
Forward
0 new messages