-
Notifications
You must be signed in to change notification settings - Fork 66
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
Fix Generate::migration() #180
Conversation
The entire syntax is stupid and should be revised. Trying to fix things that are broken beyond repair is a waist of time imho... Added this issue to the requirements discussion for 2.0: fuelphp-storage/fuelphp#24 |
Which is you say "stupid syntax" about my codes? or is it "arguments syntax"? |
If you meaned the first, I try to fix them.Else, I would join your discus. |
Wasn't about your code. 😃 i think |
I propose the following. php oil g migration create articles title:varchar[255] content:text created_at:int
php oil g migration rename_table articles posts
php oil g migration add title articles title:varchar[255]
php oil g migration delete title articles
php oil g migration rename_field created_at posted_at articles
php oil g migration drop articles |
Better, but still not really flexible, especially not if you have a table with 40 columns... |
Hmm... How is the approach like the xargs? # exmple
cat | php oil migration create articles -x
title:varchar[255]
content:text
created_at:int
updated_at:int
# ctrl + d
Creating migration: /path/to/001_create_article.php
# this is emulating the below.
# cat | xargs php oil g migration create articles In consideration of the environment where the xargs is not installed, the option which carries out xargs conversion of the standard input is added to the oil command. What do you think? |
That won't work on Windows (and maybe other platforms too). The best bet I think is to create some sort of shell, in which you can type commands like |
Does it mean a thing like an interactive tool (for example, oil console)? |
If so, it will be a big work as your saying. However, we need the small fix of this issue for 1.x. |
@FrenkyNet your opinion? I don't like the dots at all, but don't see any other quick fix for this issue... |
This fixes the root of #177
Current magic migrations does not care of the case where the column name (or table name) contains underscores (or reserved words for example to, from and in).
In order to split the strict sense of the word, should not use underscores as concatenation character.
I propose the "." instead of the "".
But generating still allows "" for compatibility.
The cases of current.
This change enables the followings.