1
0

More than 3 years have passed since last update.

Rails6 rails consoleからカラムのデータ型を確認する

Posted at

目的

  • rails consoleからのカラムのデータ型の確認方法をまとめる

実施方法

  1. railsアプリ名フォルダ直下で下記コマンドを実行してrails consoleを起動する。

    $ rails console
    
  2. rails console上で下記コマンドを実行してカラムのデータ型を確認する。

    >モデルの名前.columns_hash['カラムの名前'].type
    
1
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
1
0