Re: Idempotent DDL Updates

2021-08-30 Thread Julien Rouhaud
On Mon, Aug 30, 2021 at 11:56 PM Miles Elam wrote: > > Not sure that querying the catalogs is strictly necessary though… Could you > say more? I meant for anything that doesn't have an IF [NOT] EXISTS, including cases where such a clause wouldn't be possible. For instance if you have to

Re: Idempotent DDL Updates

2021-08-30 Thread Adrian Klaver
On 8/30/21 8:56 AM, Miles Elam wrote: On Fri, Aug 27, 2021 at 7:14 PM Julien Rouhaud > wrote: Note that the IF EXISTS / IF NOT EXISTS are *not* idempotent.  If you need to write idempotent schema update scripts, you need to query the catalogs to check

Re: Idempotent DDL Updates

2021-08-30 Thread Miles Elam
On Fri, Aug 27, 2021 at 7:14 PM Julien Rouhaud wrote: > > Note that the IF EXISTS / IF NOT EXISTS are *not* idempotent. If you > need to write idempotent schema update scripts, you need to query the > catalogs to check if the specific change you want to apply has already > been applied or not.

Re: Idempotent DDL Updates

2021-08-27 Thread Julien Rouhaud
On Sat, Aug 28, 2021 at 2:19 AM Miles Elam wrote: > > What is the general consensus within the community on idempotent DDL scripts, > ie. consistent usage of IF EXISTS/IF NOT EXISTS/OR REPLACE for SQL init files > that get checked into source control? > [...] > The drawbacks I've run across are

Re: Idempotent DDL Updates

2021-08-27 Thread Rob Sargent
> On Aug 27, 2021, at 1:32 PM, Adrian Klaver wrote: > > On 8/27/21 11:19 AM, Miles Elam wrote: >> What is the general consensus within the community on idempotent DDL >> scripts, ie. consistent usage of IF EXISTS/IF NOT EXISTS/OR REPLACE for SQL >> init files that get checked into source

Re: Idempotent DDL Updates

2021-08-27 Thread Adrian Klaver
On 8/27/21 11:19 AM, Miles Elam wrote: What is the general consensus within the community on idempotent DDL scripts, ie. consistent usage of IF EXISTS/IF NOT EXISTS/OR REPLACE for SQL init files that get checked into source control? My experience has been that it's much easier to manage than

Idempotent DDL Updates

2021-08-27 Thread Miles Elam
What is the general consensus within the community on idempotent DDL scripts, ie. consistent usage of IF EXISTS/IF NOT EXISTS/OR REPLACE for SQL init files that get checked into source control? My experience has been that it's much easier to manage than an ever-growing set of migration files, but