add_index "user_roles", "user_id", :name => 'user_roles_user'
add_index "user_roles", "resource_id", :name => 'user_roles_resource'
end
-
- def self.down
- drop_table :user_roles
- end
end
# sonar 2.0
class CreateDefaultUsersAndGroups < ActiveRecord::Migration
+ class GroupRole < ActiveRecord::Base
+ end
+
+ class Group < ActiveRecord::Base
+ end
+
def self.up
+ Group.reset_column_information
+ GroupRole.reset_column_information
+
create_administrators
create_users
end
#
# sonar 2.0
class SetDefaultProjectRoles < ActiveRecord::Migration
-
+
+ class Group < ActiveRecord::Base
+ end
+
+ class GroupRole < ActiveRecord::Base
+ end
+
def self.up
+ Group.reset_column_information
+ GroupRole.reset_column_information
+
administrators=Group.find_by_name('sonar-administrators')
users=Group.find_by_name('sonar-users')
#
class AddActiveFieldOnUsers < ActiveRecord::Migration
- class User < ActiveRecord::Base
- end
-
def self.up
add_column 'users', 'active', :boolean, :null => true, :default => true
* Use faux models when touching rows (SELECT/INSERT/UPDATE/DELETE). See http://guides.rubyonrails.org/migrations.html#using-models-in-your-migrations
for more details.
+ IMPORTANT : do not use faux models for User. The algorithm to encrypt passwords is required during migrations.
class MyMigration < ActiveRecord::Migration
# This is the faux model. It only maps columns. No functional methods.