[Cubicweb] [postgis] Enable Postgis extension the right way

Yann Vote yann.vote at logilab.fr
Tue Jun 23 13:31:56 CEST 2015

On 06/23/2015 12:05 PM, David Douard wrote:
> On 06/09/2015 10:22 AM, Sylvain Thénault wrote:
>> On 09 juin 09:44, Nicolas Chauvat wrote:
>>> On Tue, Jun 09, 2015 at 09:33:28AM +0200, Sylvain Thénault wrote:
>>>> Huuum, that's an idea. On my side I feel like the [pre/post]create.py file is
>>>> pretty convenient and would keep on going that way for such needs, but I would
>>>> be happy to hear other's opinion.
>>> What is the problem that [pre/post]create.py solves conveniently?
>> creating various - installation related - things such as creating workflows,
>> setting some properties and all.
>> IMO having this in an "isolated" python file rather than using the hook machinery
>> is good.
> [pre/post]create.py are a problem for me, since I more and more often do NOT use
> cubicweb-ctl to create the database: I'm using salt to handle database set up for
> a cw instance, so any magic stuff done by cubicweb-ctl at database creation time
> should be avoided.

I agree that database setup should be skippable, for example when it is 
first created by a DBA. And actually this is almost the case: 
cubicweb-ctl asks for confirmation before running db-create and db-init. 
One great thing would be to provide an additional switch for the 
--automatic option: something like "--automatic --no-db-create" would 
provide an automatic instance creation without forcing database creation.

But there are cases when one does not use salt or does not want to 
create database first before CW uses it. In such a case, we would expect 
cubicweb-ctl to handle all the details of database set-up, including 
"magic stuff". We cannot avoid that.

So back to the discussion, I acknowledge that .py files may not be the 
best way to execute SQL commands. .sql scripts would provide same 
feature, would better interact with other tools such as salt, at the 
(little) cost of having more files to maintain in migration folder.


More information about the Cubicweb mailing list