From 8355efa1dc4fc16cfe2bce3c8d72b7a0b2912f21 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sun, 15 Mar 2020 11:57:35 -0600 Subject: Generate Account model --- rvh/app/models/account.rb | 2 ++ rvh/db/migrate/20200315175547_create_accounts.rb | 12 ++++++++++++ rvh/db/schema.rb | 11 ++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 rvh/app/models/account.rb create mode 100644 rvh/db/migrate/20200315175547_create_accounts.rb diff --git a/rvh/app/models/account.rb b/rvh/app/models/account.rb new file mode 100644 index 0000000..c17a874 --- /dev/null +++ b/rvh/app/models/account.rb @@ -0,0 +1,2 @@ +class Account < ApplicationRecord +end diff --git a/rvh/db/migrate/20200315175547_create_accounts.rb b/rvh/db/migrate/20200315175547_create_accounts.rb new file mode 100644 index 0000000..6868a29 --- /dev/null +++ b/rvh/db/migrate/20200315175547_create_accounts.rb @@ -0,0 +1,12 @@ +class CreateAccounts < ActiveRecord::Migration[6.0] + def change + create_table :accounts do |t| + t.string :name, null: false + t.string :address, null: false + t.datetime :birth_date, null: false + t.string :phone_number + + t.timestamps + end + end +end diff --git a/rvh/db/schema.rb b/rvh/db/schema.rb index 79b5c13..c875a31 100644 --- a/rvh/db/schema.rb +++ b/rvh/db/schema.rb @@ -10,6 +10,15 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 0) do +ActiveRecord::Schema.define(version: 2020_03_15_175547) do + + create_table "accounts", force: :cascade do |t| + t.string "name", null: false + t.string "address", null: false + t.datetime "birth_date", null: false + t.string "phone_number" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end end -- cgit v1.2.3