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

[Proposal] VARBINARY mysql type #3297

Closed
felixsanz opened this issue Jan 19, 2014 · 3 comments
Closed

[Proposal] VARBINARY mysql type #3297

felixsanz opened this issue Jan 19, 2014 · 3 comments

Comments

@felixsanz
Copy link

There is actually BINARY, but not VARBINARY.

VARBINARY is great for storing ip addresses. VARBINARY field is compatible with ipv4 and ipv6 at the same time, BINARY only with ipv6. This will avoid using VARCHAR.

@RSully
Copy link
Contributor

RSully commented Jan 20, 2014

Is it safe to assume there are similar types in other databases besides mysql? Take a look at the list of supported PDO engines.

@taylorotwell
Copy link
Member

Can you just use a varchar field? I don't want to get into adding too many custom fields. You can add the alter table SQL manually in the migration if you really need something custom.

@felixsanz
Copy link
Author

@taylorotwell varchar is slow/unefficient for this, but thanks for the alter table tip in migration. i was altering the table using mysql tools, but that loses sync with the migrations. I will use laravel's alter table instead.

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

3 participants