1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-03-11 03:33:07 +00:00

Force the default value of path to be set on the Change model class. This is needed because MySQL does not support default values on text columns (Error introduced in r3828, #5771)

This commit is contained in:
Holger Just 2010-07-06 19:36:33 +02:00
parent 75d5ab431f
commit 89cb1b9c8b
2 changed files with 5 additions and 1 deletions

View File

@ -23,4 +23,8 @@ class Change < ActiveRecord::Base
def relative_path
changeset.repository.relative_path(path)
end
def before_save
path ||= ""
end
end

View File

@ -1,6 +1,6 @@
class ChangeChangesPathLengthLimit < ActiveRecord::Migration
def self.up
change_column :changes, :path, :text, :default => "", :null => false
change_column :changes, :path, :text, :null => false
change_column :changes, :from_path, :text
end