https://medium.com/@deallen7/ruby-on-rails-app-build-blog-3d9975a999ae
author: Ling Li
ruby version: ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu] rails version: Rails 5.2.3
$ rails new RubyBlog
$ rails s
$ rails g migration create_articles
$ rake db:migrate
$ rake db:rollback
$ rails c
$ Article.all
article = Article.new(title: "This is my second article", description: "This is my second description")
article.save
article = Article.find(1)
article.title = "This is an edited second article"
article.save
article.destroy
rake routes
$ rails g migration create_users
update columns
goto directory: db/migrate/20190802034934_create_users.rb
class CreateUsers < ActiveRecord::Migration[5.1] def change create_table :users do |t| t.string :username t.string :email t.timestamps end end end
then: $ rake db:migrate