Feature request -- Add option to generate conditional execution of create statements.
0 views
Skip to first unread message
Faron Dutton
unread,
Apr 1, 2012, 10:11:51 AM4/1/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DB Solo
I typically surround my create statements with a test to see if the
object already exists before creating the object.
A PostgreSQL example:
declare @C;
set @C = select count (*) from information_schema.tables where
table_schema = 'foo' and table_name = 'bar';
if cast (@C as integer) = 0
begin
create table bar ...
end
I keep a single upgrade script to reduce the amount of work required
when deploying changes to Production. This poses problems when doing
incremental development and deploying to QA. The script is written so
that it will not fail in QA if a table already exists but ensures that
everything is added to Production.