0

alter_table(:pages) do add_column :about, Text end

when running the migration rake sq:migrate I get

rake aborted! NameError: uninitialized constant Text

How do i create a text data type. I did follow the docs but sequel doc has very less eg.

Update 1

I can use Text :about when creating a table in migration but the issue persist in altering table

Vamsi Krishna
  • 3,742
  • 4
  • 20
  • 45
Raaz
  • 1,669
  • 2
  • 24
  • 48

1 Answers1

4

You likely figured this out already, but you can specify a text data type in Sequel like so:

alter_table(:pages) do
  add_column :about, String, text: true
end

See documentation for more details.

This works also and is more concise:

alter_table(:pages) do
  add_column :about, :text
end
Markus
  • 2,071
  • 4
  • 22
  • 44
Ray Walters
  • 56
  • 1
  • 2