propel:sql:build removes app/propel/sql directory #170

Closed
Martiusweb opened this Issue Jul 30, 2012 · 4 comments

Projects

None yet

2 participants

@Martiusweb

Hello,

I would like to load custom sql files when running the task sql:insert, I followed the guide following guide:
http://www.propelorm.org/cookbook/adding-additional-sql-files.html

but unfortunately propel:sql:build clears the directory before to execute the phing task.

in SqlBuildCommand.php at line 62:

        $filesystem->remove($sqlDir);
        $filesystem->mkdir($sqlDir);

I am no sure that it's required to clear older generated files, if it is, it would be great to delete only the files to be generated.

One incomplete fix or workaround would be to copy the sql/ directory and restore the files that are in the original directory in the newly created one.

Regards,
Martin

@willdurand
Member

The $sqlDir should be in the cache actually. This is a mistake.

@Martiusweb

Okay, so I'll set $sqlDir to be in the kernel's cache directory and copy the generated files in propel/sql.
The only edge case to handle is the merge of sqldb.map.

@willdurand
Member

I think we should not use propel:sql:insert for that. Or we need an
option...

2012/7/31 Martin Richard <
reply@reply.github.com

Okay, so I'll set $sqlDir to be in the kernel's cache directory and copy
the generated files in propel/sql.
The only edge case to handle is the merge of sqldb.map.


Reply to this email directly or view it on GitHub:
#170 (comment)

@Martiusweb

I don't understand why sql:insert could not be used, isn't it a proxy for some task of propel generator?

Anyway, I made a short patch for sql:build which merges generated files.

@willdurand willdurand closed this Aug 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment