Merged trunk r1773.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1774 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class Setup < ActiveRecord::Migration
|
||||
|
||||
|
||||
class User < ActiveRecord::Base; end
|
||||
# model removed
|
||||
class Permission < ActiveRecord::Base; end
|
||||
|
||||
@@ -284,13 +285,15 @@ class Setup < ActiveRecord::Migration
|
||||
Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322
|
||||
|
||||
# create default administrator account
|
||||
user = User.create :firstname => "Redmine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en"
|
||||
user.login = "admin"
|
||||
user.password = "admin"
|
||||
user.admin = true
|
||||
user.save
|
||||
|
||||
|
||||
user = User.create :login => "admin",
|
||||
:hashed_password => "d033e22ae348aeb5660fc2140aec35850c4da997",
|
||||
:admin => true,
|
||||
:firstname => "Redmine",
|
||||
:lastname => "Admin",
|
||||
:mail => "admin@example.net",
|
||||
:mail_notification => true,
|
||||
:language => "en",
|
||||
:status => 1
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class AddEnumerationsPosition < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column(:enumerations, :position, :integer, :default => 1) unless Enumeration.column_names.include?('position')
|
||||
Enumeration.find(:all).group_by(&:opt).each_value do |enums|
|
||||
Enumeration.find(:all).group_by(&:opt).each do |opt, enums|
|
||||
enums.each_with_index do |enum, i|
|
||||
# do not call model callbacks
|
||||
Enumeration.update_all "position = #{i+1}", {:id => enum.id}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class AddCustomFieldsPosition < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column(:custom_fields, :position, :integer, :default => 1)
|
||||
CustomField.find(:all).group_by(&:type).each_value do |fields|
|
||||
CustomField.find(:all).group_by(&:type).each do |t, fields|
|
||||
fields.each_with_index do |field, i|
|
||||
# do not call model callbacks
|
||||
CustomField.update_all "position = #{i+1}", {:id => field.id}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddWikiPagesProtected < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :wiki_pages, :protected, :boolean, :default => false, :null => false
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :wiki_pages, :protected
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class ChangeProjectsHomepageLimit < ActiveRecord::Migration
|
||||
def self.up
|
||||
change_column :projects, :homepage, :string, :limit => nil, :default => ''
|
||||
end
|
||||
|
||||
def self.down
|
||||
change_column :projects, :homepage, :string, :limit => 60, :default => ''
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,9 @@
|
||||
class AddWikiPagesParentId < ActiveRecord::Migration
|
||||
def self.up
|
||||
add_column :wiki_pages, :parent_id, :integer, :default => nil
|
||||
end
|
||||
|
||||
def self.down
|
||||
remove_column :wiki_pages, :parent_id
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user