It's not highlighted, but in the documentation above the table of column 
type mappings, it does state that Sequel will choose `text` or `varchar` 
depending on the underlying database.

For Postgres, `text` is frequently the best choice, as Postgres will manage 
data placement for you automatically, depending on the size of the data 
provided.

If you really want a `varchar(255)`, provide a size when creating the 
column:

  String :a1, :size => 255

On Thursday, May 26, 2022 at 3:33:57 AM UTC-4 Thiebo wrote:

> Hello,
>
> I'm using sequel 5.55.
>
> In a migration I have this:
>
> create_table(:accounts) do
>       primary_key :id, :type=>:Bignum
>       String :intitule, null: false
> end
>
> According to the documentation 
> <https://sequel.jeremyevans.net/rdoc/files/doc/schema_modification_rdoc.html>,
>   
> String with no further specification should result in the database type 
> varchar(255) :
>
> String :a1                        # varchar(255)
>
> however, after running the migration, the table shows: 
>
> \d+ accounts
>
>  intitule    | *text*                        |
>
> How should I create the datatype character varying? 
>
> Thanks,
>
> Thiebo
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/73911f73-360a-4a1f-bab3-e628c0d3eafdn%40googlegroups.com.

Reply via email to