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

Escaping of reserved words in schema name #32

Open
ishenkoyv opened this issue Aug 5, 2015 · 6 comments
Open

Escaping of reserved words in schema name #32

ishenkoyv opened this issue Aug 5, 2015 · 6 comments
Labels
Milestone

Comments

@ishenkoyv
Copy link

If we create schema with name "user" cli generator should create relations with escaped schema name as it's reserved word. E.g.

AutoStructure/Table.php should contains ->setRelation('"user".table') instead of ->setRelation('user.table')

@chanmix51 chanmix51 added the bug label Aug 6, 2015
@stood
Copy link
Member

stood commented Sep 11, 2015

I am watching this bug and what's the best solutions :

  • Always escape the schema name
  • escape the schema name if the word is reserved

@tlode
Copy link
Contributor

tlode commented Sep 11, 2015

Hi @stood, I vote for he first solution. The generator should always escape. But why not the relation name too? This way, there wouldn't be the need to maintain a reserved keyword list. Uppercase relation names would safely work too (perhaps they already do, I don't know).

@stood
Copy link
Member

stood commented Sep 11, 2015

Hi @tlode I'm agree with you

@stood
Copy link
Member

stood commented Sep 30, 2015

And pomm-project/ModelManager@c2b531c :)

@chanmix51
Copy link
Member

yes, this is an issue in itself, but re-factoring this means changing Cli, PommBundle and PommModule so we will wait for the next release branch to do that.

@chanmix51
Copy link
Member

chanmix51 commented Oct 2, 2015

The commits have been rollbacked. They induce hard to track problems in projections and embedded entities. This problem will be addressed in the 2.1 release as it requires a bit of refactoring.

@chanmix51 chanmix51 reopened this Oct 2, 2015
@chanmix51 chanmix51 added this to the 2.1 milestone Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants