aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorAlban Peignier2012-04-13 17:44:39 +0200
committerAlban Peignier2012-04-13 17:44:39 +0200
commitfbedb1806047513455f0c54c71e841e3c6a1d623 (patch)
treeff9ba58c3297f906176cbbae46fc885f97fd8997 /db
parent32800f1b63dc19598d171a2fa3a8df7994705d29 (diff)
downloadchouette-core-fbedb1806047513455f0c54c71e841e3c6a1d623.tar.bz2
First devise integration. Refs #7
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20120413142837_devise_create_users.rb49
-rw-r--r--db/schema.rb76
2 files changed, 68 insertions, 57 deletions
diff --git a/db/migrate/20120413142837_devise_create_users.rb b/db/migrate/20120413142837_devise_create_users.rb
new file mode 100644
index 000000000..540333c5c
--- /dev/null
+++ b/db/migrate/20120413142837_devise_create_users.rb
@@ -0,0 +1,49 @@
+class DeviseCreateUsers < ActiveRecord::Migration
+ def change
+ create_table(:users) do |t|
+ ## Database authenticatable
+ t.string :email, :null => false, :default => ""
+ t.string :encrypted_password, :null => false, :default => ""
+
+ ## Recoverable
+ t.string :reset_password_token
+ t.datetime :reset_password_sent_at
+
+ ## Rememberable
+ t.datetime :remember_created_at
+
+ ## Trackable
+ 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
+
+ ## Encryptable
+ # t.string :password_salt
+
+ ## Confirmable
+ # t.string :confirmation_token
+ # t.datetime :confirmed_at
+ # t.datetime :confirmation_sent_at
+ # t.string :unconfirmed_email # Only if using reconfirmable
+
+ ## Lockable
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
+ # t.datetime :locked_at
+
+ ## Token authenticatable
+ # t.string :authentication_token
+
+
+ t.timestamps
+ end
+
+ add_index :users, :email, :unique => true
+ add_index :users, :reset_password_token, :unique => true
+ # add_index :users, :confirmation_token, :unique => true
+ # add_index :users, :unlock_token, :unique => true
+ # add_index :users, :authentication_token, :unique => true
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 4b3e892f5..8bb44407d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,63 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120214101645) do
-
- create_table "company", :force => true do |t|
- t.string "objectid"
- t.integer "objectversion"
- t.datetime "creationtime"
- t.string "creatorid"
- t.string "name"
- t.string "shortname"
- t.string "organizationalunit"
- t.string "operatingdepartmentname"
- t.string "code"
- t.string "phone"
- t.string "fax"
- t.string "email"
- t.string "registrationnumber"
- end
-
- add_index "company", ["objectid"], :name => "company_objectid_key", :unique => true
- add_index "company", ["registrationnumber"], :name => "company_registrationnumber_key", :unique => true
-
- create_table "line", :force => true do |t|
- t.integer "ptnetworkid", :limit => 8
- t.integer "companyid", :limit => 8
- t.string "objectid"
- t.integer "objectversion"
- t.datetime "creationtime"
- t.string "creatorid"
- t.string "name"
- t.string "number"
- t.string "publishedname"
- t.string "transportmodename"
- t.string "registrationnumber"
- t.string "comment"
- t.boolean "mobilityrestrictedsuitable"
- t.integer "userneeds", :limit => 8
- end
-
- add_index "line", ["objectid"], :name => "line_objectid_key", :unique => true
- add_index "line", ["registrationnumber"], :name => "line_registrationnumber_key", :unique => true
-
- create_table "ptnetwork", :force => true do |t|
- t.string "objectid"
- t.integer "objectversion"
- t.datetime "creationtime"
- t.string "creatorid"
- t.date "versiondate"
- t.string "description"
- t.string "name"
- t.string "registrationnumber"
- t.string "sourcename"
- t.string "sourceidentifier"
- t.string "comment"
- end
-
- add_index "ptnetwork", ["objectid"], :name => "ptnetwork_objectid_key", :unique => true
- add_index "ptnetwork", ["registrationnumber"], :name => "ptnetwork_registrationnumber_key", :unique => true
+ActiveRecord::Schema.define(:version => 20120413142837) do
create_table "referentials", :force => true do |t|
t.string "name"
@@ -75,4 +19,22 @@ ActiveRecord::Schema.define(:version => 20120214101645) do
t.datetime "updated_at"
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"
+ t.datetime "updated_at"
+ 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