summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2021-04-30 21:38:37 -0600
committermo khan <mo@mokhan.ca>2021-04-30 21:38:37 -0600
commitb85d5d43855501c9866c1ab4442aced3d4250664 (patch)
tree0e6fc8a8381732bc9c64e877d36ccac207660ae5 /db
parentf24dfbde3eafcc9be39a7c246263d49b9a12fb3a (diff)
feat: generate users scaffold
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20210501030808_create_users.rb9
-rw-r--r--db/schema.rb9
2 files changed, 17 insertions, 1 deletions
diff --git a/db/migrate/20210501030808_create_users.rb b/db/migrate/20210501030808_create_users.rb
new file mode 100644
index 0000000..784c76b
--- /dev/null
+++ b/db/migrate/20210501030808_create_users.rb
@@ -0,0 +1,9 @@
+class CreateUsers < ActiveRecord::Migration[6.1]
+ def change
+ create_table :users do |t|
+ t.string :handle, null: false
+ t.timestamps
+ end
+ add_index :users, :handle, unique: true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 77bcf0f..0b5418d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,6 +10,13 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 0) do
+ActiveRecord::Schema.define(version: 2021_05_01_030808) do
+
+ create_table "users", force: :cascade do |t|
+ t.string "handle", null: false
+ t.datetime "created_at", precision: 6, null: false
+ t.datetime "updated_at", precision: 6, null: false
+ t.index ["handle"], name: "index_users_on_handle", unique: true
+ end
end