Re: [Modeling-users] ModelMasons refactored
Status: Abandoned
Brought to you by:
sbigaret
|
From: Sebastien B. <sbi...@us...> - 2003-04-22 17:14:20
|
Mario Ruggier <ma...@ru...> writes:
> >> mdl_generate_DB_schema.py
> >> - when creating a table the first time around, all DROP statements fai=
l,
> >> and execution stops unless the -i switch is used. Shouldn't DROP of
> >> non-existant stuff not be treated like an error?
> >
> > Not sure what you mean here:
> >
> > $ mdl_generate_DB_schema.py -C -v \
> >> --admin-dsn=3D"localhost:template1:postgres:" ./model_StoreEmployees.x=
ml
> >
> > does not try any drop statements. Could you be more precise on which
> > situation(s) it annoys you?
>=20
> mdl_generate_DB_schema.py -v -A model.xml
>=20
> Sorry, I was just being too lazy, and wanted to execute the same command
> whether it is the first time creating the table, or early interations of =
the
> model
> (requiring frequent regeneration). Hadn't "registered" the -C switch...
If you *really* want to be lazy, you'll probably find '-R -i' handy :)=20
BTW '-A' does not create the database, but with an existing database
'-A --ignore-errors' will ignore the initial & failing DROP TABLE.
Related to the topic: I just committed a slight change in
AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor which apparently
solves a annoying pb. w/ postgresql (and maybe mysql as well), where
the creation of the db can fail when tried just after a 'DROP DB';
postgresql error is then:
ERROR: CREATE DATABASE: source database "template1" is being accessed by
other users
Obviously this is the case in mdl_generate_DB_schema with option -R.
-- S=E9bastien.
|