8000 [Proposal] Implement an 'after' modifier to the mysql schema by helmut · Pull Request #73 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[Proposal] Implement an 'after' modifier to the mysql schema #73

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

Closed
wants to merge 1 commit into from
Closed

[Proposal] Implement an 'after' modifier to the mysql schema #73

wants to merge 1 commit into from

Conversation

helmut
Copy link
Contributor
@helmut helmut commented Jan 16, 2013
Schema::table('users', function($table)
{
    $table->integer('age')->after('name');
});

It would be great to be able to specify that you want a column to be added to a table in a specific position. This functionality is sparsely supported across all the database types. I'm pretty sure postgres does not allow you to do this at all.

Should this functionality be added to the core or because it cannot be applied to all database types it should therefore be left out?

I've added the code as an example but if you guys want to go ahead I can create some tests and look into adding similar functionality to some of the other database types (the ones that can handle this functionality of course).

@robclancy
Copy link
Contributor

Yes please! Have wanted this for ages. Can't stand my tables being in random orders.

@ipalaus
Copy link
Contributor
ipalaus commented Jan 17, 2013

👍

@spencerdeinum
Copy link
Contributor

This might work for creation, but I know for a fact that SQLite does not support reordering columns.

In fact, to emulate that in sqlite you actually have to add and drop columns, or recreate the table.

Part of me wants to say that this is really independent of your migrations. If it bothers you I would suggest doing it manually.

@robclancy
Copy link
Contributor

How does it not working with SQLite present a problem? The method would just return $this.

@Kindari
Copy link
Kindari commented Jan 19, 2013

Since this is merely a presentation oriented feature and not a functional one, on databases that do not support it such as sqlite I think its perfectly acceptable to just ignore it.

@taylorotwell
8000 Copy link
Member

I don't think this is a good idea to implement right now. Thank you though.

@helmut
Copy link
Contributor Author
helmut commented Mar 13, 2013

I see this has now been added to the core... Not trying to be annoying but can I ask why you changed your mind? Why is this now a good idea to implement but not earlier? Just for understanding the proposal process a bit more...

@Kindari
Copy link
Kindari commented Mar 13, 2013

@helmut well Taylor didn't say it was a bad idea, he said it wasn't a good idea to implement "right now" which was two months ago. Things have obviously changed. hooray.

@taylorotwell
Copy link
Member

No huge reasons. Opinions just change sometimes. :)

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

Successfully merging this pull request may close these issues.

6 participants
0