LoginSignup
0
0

More than 5 years have passed since last update.

' t.text 'に指定できる字数

Last updated at Posted at 2016-10-17

データベースに' t.text 'を用い、カラムを作成した際の字数指定について。

指定できる字数は、以下のようになっています。

t.text :hoge, limit: 255
t.text :hoge, limit: 65535
t.text :hoge, limit: 16777215
t.text :hoge, limit: 4294967295

' t.string 'などとは違い、上記以外の値を記述してもschemaには反映されないので注意です。
指定した後は、保存して、

bundle exec rake db:reset:migrate

でschemaを再生成しましょう。

当記事が、どなたかの一助となれば幸いです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0