Skip to content

binary() field in Schema Builder #1606

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
aklinkert opened this issue Jun 11, 2013 · 10 comments
Closed

binary() field in Schema Builder #1606

aklinkert opened this issue Jun 11, 2013 · 10 comments

Comments

@aklinkert
Copy link

I hardly need to create a column of type binary$length) in MySQL but had to assert, that the $fluent->binary() method isn't building a BINARY but a BLOB field.

So what could be a possible sulution for this? Adding a new Fluent Method? In Laravel 3 I was easyly able to hack and dirty change the frameworks code to my needings, but with composer it luckily not possible.

Any ideas guys?

Cheers,
Bodo06

@taylorotwell
Copy link
Member

Just do a DB::statement call and run the raw SQL you need to generate your column.

@fgambino
Copy link

fgambino commented Jun 9, 2014

The only reason I can think of why this isn't implemented is that not all database types support the binary column. If that isn't the case, I would really like to see this added to Laravel.

@spronkey
Copy link

spronkey commented Feb 3, 2015

I'd definitely agree that this should be supported in some form, primarily for support for UUIDs.

@rafis
Copy link
Contributor

rafis commented Jul 8, 2015

@whoacowboy
Copy link
Contributor

+1 for adding binary support

@linux019
Copy link

I agree this is a bug, binary isn't the blob in mysql

@Petah
Copy link

Petah commented Jul 10, 2018

+1

1 similar comment
@friendlygh0st
Copy link

+1

@johnss
Copy link

johnss commented Sep 15, 2019

@mpskovvang
Copy link
Contributor

It seems like you can just set the character set to binary as a workaround:

$table->char('url_hash', 16)->charset('binary');

This is actually shown as a real binary column type with a length of 16 in MySQL Workbench.

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

No branches or pull requests