summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-03-15 11:57:35 -0600
committermo khan <mo.khan@gmail.com>2020-03-15 11:57:35 -0600
commit8355efa1dc4fc16cfe2bce3c8d72b7a0b2912f21 (patch)
tree6e8ff363cbb947ae5d45de399f62de540bbe9800
parent79cba187692c9964dd7a3b97c323768566347f40 (diff)
Generate Account model
-rw-r--r--rvh/app/models/account.rb2
-rw-r--r--rvh/db/migrate/20200315175547_create_accounts.rb12
-rw-r--r--rvh/db/schema.rb11
3 files changed, 24 insertions, 1 deletions
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