[katello-devel] Katello-reset-dbs question

Lukas Zapletal lzap at redhat.com
Wed Nov 9 09:41:12 UTC 2011


On Mon, Nov 07, 2011 at 08:01:32PM -0500, Partha Aji wrote:
> 
> I recently updated a previous migrate script, but the couldn;t
> properly update the katello database via rpm through Katello-reset-db
> script. The offending line seems to be 
> 
> rake db:truncate db:migrate db:seed 
> Question I wanted to ask was, why is it not
> rake setup 
> 
> Why would one be willing to wipe out candlepin and pulp data but only
> update katello db schema instead of refreshing it completely?

Because rake setup does db:migrate:reset which leads to db:drop. Once we
started supporting PostgreSQL it was failing for me. Once the database
is dropped Rails wont create it again -> and it fails. Therefore I have
introduced new task db:truncate which just truncate all data. Please
note this DOES NOT work with sqlite3, which we do not support anymore.

Database was not dropped in case there were some active connections
(katello or jobs running). In this case it was "working" because
PostgreSQL refused to drop the database.

If there is better solution I would be happy implementing it

-- 
Later,

 Lukas Zapletal | E32E400A
 RHN Satellite Engineering
 Red Hat Czech s.r.o. Brno




More information about the katello-devel mailing list