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

Feature Suggestion: Composite Indexes #5

Open
EdRands opened this issue Jul 9, 2013 · 1 comment
Open

Feature Suggestion: Composite Indexes #5

EdRands opened this issue Jul 9, 2013 · 1 comment

Comments

@EdRands
Copy link

EdRands commented Jul 9, 2013

When creating a typical Laravel migration, I can specify a composite index / unique / primary key like so:

$table->index(array('first_name', 'last_name'));

Here's the documentation.

For those times when they are needed, it would be nice to set them up in Larry, rather than add them afterwards. Example:

People
    first_name string
    last_name string
    index first_name, last_name;

Though I suppose that would be differentiated from a table column that's supposed to named "index".

Perhaps:

People
    first_name string
    last_name string; index first_name, last_name;

Thanks for the handy tool you've made!

@XCMer
Copy link
Owner

XCMer commented Jul 10, 2013

I'll surely add this. I'm not yet sure about the exact syntax, but I'll come up with something. The first alternative you suggested looks good and non-hacky.

Differentiation might become tricky, since I'd be supporting single indices using that syntax as well. Maybe the case of the first keyword can decide that. I'll look out for a way.

Thanks for the recommendation, though.

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

No branches or pull requests

2 participants