]> source.dussan.org Git - redmine.git/commitdiff
Fixed #1545: migration on fresh install fails (broken by r1592).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jun 2008 08:14:13 +0000 (08:14 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 29 Jun 2008 08:14:13 +0000 (08:14 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1595 e93f8b46-1217-0410-a6f0-8f06a7374b81

db/migrate/001_setup.rb

index 1160dd5efa370659aa9a3e6372e187dcd610c8cc..13960ba8c96fbf28417cb0e39c85fe10caeadbea 100644 (file)
@@ -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\r
     \r
     # create default administrator account\r
-    user = User.create :firstname => "Redmine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en"
-    user.login = "admin"
-    user.password = "admin"\r
-    user.admin = true\r
-    user.save\r
-    \r
-    \r
+    user = User.create :login => "admin",
+                       :hashed_password => "d033e22ae348aeb5660fc2140aec35850c4da997",
+                       :admin => true,
+                       :firstname => "Redmine",
+                       :lastname => "Admin",
+                       :mail => "admin@somenet.foo",
+                       :mail_notification => true,
+                       :language => "en",
+                       :status => 1
   end
 
   def self.down\r