0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ずら〜っと、Railsでデータベースを確認する方法一覧

Last updated at Posted at 2019-12-21

データベースクライアントの起動
$ rails dbconsole

こうなる
sqlite>

テーブル一覧の見方
sqlite> .tables

指定したテーブルのカラムの確認方法(スキーマの確認)
.schema テーブル名

カラムを追加
$ rails generate migration Addカラム名toテーブル名 カラム名:データ型

テーブルの中身を確認
sqlite> select * from テーブル名

マイグレートファイルをDBに反映
rails db:migrate

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?