Closed hackoh closed 11 years ago
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: https://github.com/fuelphp/fuelphp/issues/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. :smiley:
i think php oil g migration add.to_mail.to.contact_to_users to_mail:varchar[255]
is a stupid way of specifying your generation requirements.
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 add field title varchar[255]
. But that's quite a lot of work, and should be part of the 2.0 effort of redesigning oil.
The best bet I think is to create some sort of shell, in which you can type commands like add field title varchar[255].
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. I would fix this branch to my proposing syntax. (https://github.com/fuel/oil/pull/180#issuecomment-14882477) Then, would you consider merging?
@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 https://github.com/fuel/oil/pull/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.