Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional schemas #274

Open
kix opened this issue Mar 31, 2014 · 4 comments
Open

Conditional schemas #274

kix opened this issue Mar 31, 2014 · 4 comments

Comments

@kix
Copy link

kix commented Mar 31, 2014

I'm developing a bundle that gives access to some models which should be persisted differently depending on how my bundle is configured. For instance, models in my bundle can conditionally have an i18n behaviour attached if it's needed by the bundle user (that's just a single usecase, there are more as it seems to me).
So, basically I need to be able to conditionally load different schema files during container compilation.
I've stumbled upon schema.xml filename being hardcoded in Propel\PropelBundle\Command\AbstractCommand::getSchemasFromBundle, and could not find it anywhere else, not as a container parameter default value nor anything else. Does that mean that conditionally loading schemas is not possible?
If that's true, then my proposal is to let PropelBundle users define schemas Propel should use in their DependencyInjection\Extension child classes' ::load method.

@jkabat
Copy link

jkabat commented Jul 3, 2014

Kix, how did you solve your use case?

I'm facing very similar problem: I need to let application load partial schema with user tables optionally where database name will differs from the rest of the schemas.

Could I solve this other way? Eg: by overriding DATABASE_NAME in peer classes? Schema loading seems to me as much cleaner approach.

@kix
Copy link
Author

kix commented Jul 3, 2014

@jkabat, as you could notice, there's no response in this issue's thread; as I know, there is no adequate solution for my usecase yet.

@jkabat
Copy link

jkabat commented Jul 3, 2014

@kix yes, I noticed it. I just wanted to know if you have come up with some temporary solution or not. Thnx for responding right away.

@kix
Copy link
Author

kix commented Jul 3, 2014

@jkabat, well, I assumed that having multiple extraneous columns in a table is not too bad, so I don't have a solution yet :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants