diff options
Diffstat (limited to 'db')
4 files changed, 72 insertions, 0 deletions
diff --git a/db/migrate/20120823053740_create_organisation.rb b/db/migrate/20120823053740_create_organisation.rb new file mode 100644 index 000000000..d3778f057 --- /dev/null +++ b/db/migrate/20120823053740_create_organisation.rb @@ -0,0 +1,24 @@ +class CreateOrganisation < ActiveRecord::Migration + def up + create_table :organisations do |t| + t.string :name + t.timestamps + end + change_table :referentials do |n| + n.belongs_to :organisation + end + change_table :users do |u| + u.belongs_to :organisation + end + Referential.reset_column_information + User.reset_column_information + + organisation = Organisation.create! :name => "Chouette" + Referential.update_all :organisation_id => organisation.id + User.update_all :organisation_id => organisation.id + end + + def down + drop_table :organisations + end +end diff --git a/db/migrate/20120824094751_add_name_to_user.rb b/db/migrate/20120824094751_add_name_to_user.rb new file mode 100644 index 000000000..6822e4d6e --- /dev/null +++ b/db/migrate/20120824094751_add_name_to_user.rb @@ -0,0 +1,7 @@ +class AddNameToUser < ActiveRecord::Migration + def change + change_table :users do |t| + t.string :name + end + end +end diff --git a/db/migrate/20120830092409_add_encrypt_confirm_lock_token_to_user.rb b/db/migrate/20120830092409_add_encrypt_confirm_lock_token_to_user.rb new file mode 100644 index 000000000..23425959e --- /dev/null +++ b/db/migrate/20120830092409_add_encrypt_confirm_lock_token_to_user.rb @@ -0,0 +1,23 @@ +class AddEncryptConfirmLockTokenToUser < ActiveRecord::Migration + def change + change_table :users do |t| + ## 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 + end + + end +end diff --git a/db/migrate/20120830095442_add_invitable_to_user.rb b/db/migrate/20120830095442_add_invitable_to_user.rb new file mode 100644 index 000000000..33720cb95 --- /dev/null +++ b/db/migrate/20120830095442_add_invitable_to_user.rb @@ -0,0 +1,18 @@ +class AddInvitableToUser < ActiveRecord::Migration + def change + change_table :users do |t| + t.string :invitation_token, :limit => 60 + t.datetime :invitation_sent_at + t.datetime :invitation_accepted_at + t.integer :invitation_limit + t.integer :invited_by_id + t.string :invited_by_type + + end + + # Allow null encrypted_password + change_column :users, :encrypted_password, :string, :null => true + # Allow null password_salt (add it if you are using Devise's encryptable module) + change_column :users, :password_salt, :string, :null => true + end +end |
