Support the ongoing development of Laravel.io →
posted 10 years ago
Database
Last updated 2 years ago.
0

+1 I'll be interested as well to know how to do this.

0

For anyone that comes across this, like I did myself, it creates a varchar(255) column and adds a constraint to allow only the specified strings.

https://github.com/laravel/framework/blob/5.0/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L389

return "varchar(255) check (\"{$column->name}\" in (".implode(', ', $allowed)."))";
0

Sign in to participate in this thread!

Eventy

Your banner here too?

raice raice Joined 24 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.