mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-29 12:16:11 +01:00
Fix syntax errors for upgrade of Rails version
This commit is contained in:
parent
7f567862d7
commit
86e36b07a6
9 changed files with 21 additions and 21 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration[5.2]
|
||||
def self.up
|
||||
change_column :projects, :position, :integer, {:null => true, :default => nil}
|
||||
change_column :contexts, :position, :integer, {:null => true, :default => nil}
|
||||
change_column :projects, :position, :integer, :null => true, :default => nil
|
||||
change_column :contexts, :position, :integer, :null => true, :default => nil
|
||||
end
|
||||
|
||||
def self.down
|
||||
|
|
@ -10,13 +10,13 @@ class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration[5.2]
|
|||
project.position = 0 if !project.position?
|
||||
project.save
|
||||
end
|
||||
change_column :projects, :position, :integer, {:null => false, :default => nil}
|
||||
change_column :projects, :position, :integer, :null => false, :default => nil
|
||||
|
||||
@contexts = Context.find(:all)
|
||||
@contexts.each do |context|
|
||||
context.position = 0 if !context.position?
|
||||
context.save
|
||||
end
|
||||
change_column :contexts, :position, :integer, {:null => false, :default => nil}
|
||||
change_column :contexts, :position, :integer, :null => false, :default => nil
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue