[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

dbconfig-common: running scripts _and_ an sql script in order



[CCing the maintainer of dbconfig-common because his input would be
highly useful]

Hi,

I have a question regarding database upgrades with dbconfig-common.
Currently I have the problem that I have some situations where a
database fix is needed (in case one had a very old version of the
package installed and upgraded to the least recent and now to the new
package, because there were a bug in the upgrade logic). Its no real big
problem to achieve that, because dbconfig-common supports calling
scripts. Now comes the real problem: Additional I need to run an SQL
script *after* this fix has been applied to upgrade the database.

But here is a cite from the dbconfig-common docs:
"If files exist in both data and scripts, they will both be executed in
an unspecified order."

So obvious I cannot do it this way. My first guess is to evaluate the SQL
file from within the script, but where should I install the sql file
then? Installing it to /usr/share/dbconfig-common/data/... would be the
best way, but it would lead into the installation to fail in case the
SQL script get evaluated before the script got executed. My opinion is
that dbconfig-common should be changed so that I can configure the
order. Otherwise it would be an option to run it in this order: script,
sql file. Because in a situation where you have a script AND an sql
script it is (IMHO) most likely that the script is wanted to be run
before the sql statements.

How would I handle this situation best? Any opinions?

Thanks in advance and best Regards,
Patrick


Reply to: