-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Schema::rename('oldtable','newtable') support #480
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
Conversation
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
Signed-off-by: Colin Viebrock <colin@viebrock.ca>
If it works on all DBs this will be sweeeeeets. |
that's a good feature to have :) |
As a note, we have had many people asking for this in IRC. |
@daylerees Well, get it pulled then! ;) |
@cviebrock I have no control over this one mate :) I'm sure T will get round to it soon enough. |
Tested this on PostgreSQL, was not working correctly. schema.php, line 57 "$table->rename($name);" should be changed to "$table->rename($rename);" After this fix it does work on PostgreSQL (9.1.3) I would also suggest using $new_name in stead of $rename Good luck on this pull! |
Has anyone confirmed this works on SQLServer yet? |
I will setup a VM to test this soon so we can get it in the core asap. |
I really look forward to seeing this included in an upcoming version! Thanks for the work cviebrock, Vespakoen, and daylerees. |
this will be a cool feature to have. i'm also looking forward to this feature in an upcoming version. |
Schema::rename('oldtable','newtable') support
This is exactly what I was looking for! Noticed it doesn't carry over the prefix on the rename though. Talking about the prefix(s) set in .../application/config/database.php |
Possible solution, working on mySQL:
laravel/database/schema/grammars/mysql.php line:224 |
Fixed Typos
Tested against mysql and sqlite. I don't have access to postgres or sqlserver. Also, the comments in
laravel/database/schema.php
should probably be rewritten -- I just copied them from the drop() command.