Commit 563fd3cce6b44eb6a8b482c4679c7cc8761d04f8

Authored by AntonioTerceiro
1 parent 708ad3ec

ActionItem392: fixing migrations for postgres



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1971 3f533792-8f58-4932-b0fe-aaf55b0a4547
db/migrate/036_add_published_field_to_article.rb
1 class AddPublishedFieldToArticle < ActiveRecord::Migration 1 class AddPublishedFieldToArticle < ActiveRecord::Migration
2 def self.up 2 def self.up
3 add_column :articles, :published, :boolean, :default => true 3 add_column :articles, :published, :boolean, :default => true
4 - execute('update articles set published = 1') 4 + execute('update articles set published = (1>0)')
5 5
6 add_column :article_versions, :published, :boolean, :default => true 6 add_column :article_versions, :published, :boolean, :default => true
7 end 7 end
db/migrate/037_add_dates_to_articles.rb
@@ -8,8 +8,8 @@ class AddDatesToArticles &lt; ActiveRecord::Migration @@ -8,8 +8,8 @@ class AddDatesToArticles &lt; ActiveRecord::Migration
8 8
9 def self.up 9 def self.up
10 each_table do |table| 10 each_table do |table|
11 - add_column table, :start_date, :type => :date  
12 - add_column table, :end_date, :type => :date 11 + add_column table, :start_date, :date
  12 + add_column table, :end_date, :date
13 end 13 end
14 end 14 end
15 15