From 1dacc2d690c577eec9d99171c6ea4217279727d7 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Fri, 22 Feb 2013 11:23:14 +0000 Subject: [PATCH] Add users table --- db/migrate/20130222112030_sorcery_core.rb | 16 ++++++++++++++++ db/schema.rb | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20130222112030_sorcery_core.rb diff --git a/db/migrate/20130222112030_sorcery_core.rb b/db/migrate/20130222112030_sorcery_core.rb new file mode 100644 index 0000000..24956fe --- /dev/null +++ b/db/migrate/20130222112030_sorcery_core.rb @@ -0,0 +1,16 @@ +class SorceryCore < ActiveRecord::Migration + def self.up + create_table :users do |t| + t.string :username, :null => false # if you use another field as a username, for example email, you can safely remove this field. + t.string :email, :default => nil # if you use this field as a username, you might want to make it :null => false. + t.string :crypted_password, :default => nil + t.string :salt, :default => nil + + t.timestamps + end + end + + def self.down + drop_table :users + end +end \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 530daa7..8cc6775 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130213220036) do +ActiveRecord::Schema.define(:version => 20130222112030) do create_table "feeds", :force => true do |t| t.string "title" @@ -39,4 +39,13 @@ ActiveRecord::Schema.define(:version => 20130213220036) do t.datetime "updated_at", :null => false end + create_table "users", :force => true do |t| + t.string "username", :null => false + t.string "email" + t.string "crypted_password" + t.string "salt" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + end