Skip to content

Commit

Permalink
[api] fix migration failure with MySQL from SLES 11
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jun 28, 2013
1 parent 0e3c94a commit 08c46d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/api/app/models/configuration.rb
Expand Up @@ -13,9 +13,9 @@ def render_axml()
builder = Nokogiri::XML::Builder.new

builder.configuration() do |configuration|
configuration.title( self.title ) unless self.title.blank?
configuration.description( self.description ) unless self.description.blank?
configuration.name( self.name ) unless self.name.blank?
configuration.title( self.title || "" )
configuration.description( self.description || "" )
configuration.name( self.name || "" )

configuration.schedulers do |schedulers|
Architecture.where(:available => 1).each do |arch|
Expand Down
Expand Up @@ -2,12 +2,10 @@ class AddObsnameConfiguration < ActiveRecord::Migration
def self.up
add_column :configurations, :name, :string, :default => ""
execute("alter table configurations modify title varchar(255) default '';")
execute("alter table configurations modify description text default '';")
end

def self.down
remove_column :configurations, :name
execute("alter table configurations modify title varchar(255) default NULL;")
execute("alter table configurations modify description text default NULL;")
end
end

0 comments on commit 08c46d7

Please sign in to comment.