Skip to content
Browse files

Create a few db features for Users and create MemberTypes migration

  • Loading branch information...
1 parent 33a497f commit da2543b95cbe3f6aedf4fd130d5bb5124b9c16ff @nikolaiwarner nikolaiwarner committed Jul 9, 2012
View
15 db/migrate/20120710023255_add_features_to_users.rb
@@ -0,0 +1,15 @@
+class AddFeaturesToUsers < ActiveRecord::Migration
+ def change
+ add_column :users, :fullname, :string
+ add_column :users, :title, :string
+ add_column :users, :bio, :string
+ add_column :users, :joined_at, :date
+ add_column :users, :renew_membership_at, :date
+ add_column :users, :member_type_id, :integer
+ add_column :users, :phone, :string
+ add_column :users, :address, :string
+ add_column :users, :signed_waiver, :boolean
+ add_column :users, :has_key, :boolean
+ add_column :users, :role, :string
+ end
+end
View
11 db/migrate/20120710205014_create_member_types.rb
@@ -0,0 +1,11 @@
+class CreateMemberTypes < ActiveRecord::Migration
+ def change
+ create_table :member_types do |t|
+ t.string :name
+ t.string :description
+ t.integer :donation_rate
+
+ t.timestamps
+ end
+ end
+end
View
72 db/schema.rb
@@ -0,0 +1,72 @@
+# encoding: UTF-8
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20120710205014) do
+
+ create_table "items", :force => true do |t|
+ t.string "name"
+ t.datetime "date_collected"
+ t.datetime "time_checked_in"
+ t.datetime "time_checked_out"
+ t.integer "checked_out_by"
+ t.string "tag_number"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "type"
+ t.text "desc"
+ t.boolean "checkedin", :default => true
+ t.boolean "checkedout", :default => false
+ t.string "donated_by"
+ t.string "maintained_by"
+ end
+
+ create_table "member_types", :force => true do |t|
+ t.string "name"
+ t.string "description"
+ t.integer "donation_rate"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ end
+
+ create_table "users", :force => true do |t|
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :default => "", :null => false
+ t.string "reset_password_token"
+ t.datetime "reset_password_sent_at"
+ t.datetime "remember_created_at"
+ t.integer "sign_in_count", :default => 0
+ t.datetime "current_sign_in_at"
+ t.datetime "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.string "username"
+ t.boolean "admin", :default => false
+ t.string "fullname"
+ t.string "title"
+ t.string "bio"
+ t.date "joined_at"
+ t.date "renew_membership_at"
+ t.integer "member_type_id"
+ t.string "phone"
+ t.string "address"
+ t.boolean "signed_waiver"
+ t.boolean "has_key"
+ t.string "role"
+ end
+
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
+
+end

0 comments on commit da2543b

Please sign in to comment.
Something went wrong with that request. Please try again.