mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-25 19:48:48 +01:00
I hope this fixes #666. I do not have PostgreSQL to test. Please test and reopen if this does not work
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@748 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
93bbce7636
commit
2a6ed8f002
1 changed files with 4 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class ProjectsContextsRemoveNotNullFromPosition < ActiveRecord::Migration
|
||||
def self.up
|
||||
change_column :projects, :position, :integer, {:null => true, :default => false}
|
||||
change_column :contexts, :position, :integer, {:null => true, :default => false}
|
||||
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
|
|||
project.position = 0 if !project.position?
|
||||
project.save
|
||||
end
|
||||
change_column :projects, :position, :integer, {:null => false, :default => false}
|
||||
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 => false}
|
||||
change_column :contexts, :position, :integer, {:null => false, :default => nil}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue