i'm reading agile web dev with rails and the author
discusses how he makes text sql snapshots of his
databases. when a new column needs to be added, for
example, he updates the text sql and reloads the file.
in mysql, he puts a statement like...
if table_example exists delete table_example
that is close, but not the exact code. he is trying
to delete the existing table (wrong structure) and
replace it with the new structure.
should i uncomment...
-- DROP DATABASE "edb-bms-dev";
DROP DATABASE "edb-bms-dev";
in order to get similar behavior?i tried using the if
table_example exists dyntax in pgsql and it didn't
when i was using a similar strategy, except at the
table level, the output kicked out an error saying the
table wasn't there. however, the update went as
expected - i thought the error was strange and must've
had something to do with me dropping the table.
is this the best way to control db revisions and make
updates? one facet of this plan that appeals to me is
that i can control column order within the db. this
is important when using rails b/c rails displays the
columns in order when it generates its web pages, by
i'd appreciate hearing what others do.
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
pgsql-novice by date
|Next:||From: Sean Davis||Date: 2006-05-11 17:06:28|
|Subject: Re: Dev DB Structure Updates|
|Previous:||From: Mark Campbell||Date: 2006-05-11 11:21:48|
|Subject: Compiling on 8.1.3 on Openserver 5.05|