Merge pull request #2818 from rekado/fix_migration_for_psql

fix syntax for psql backend
This commit is contained in:
Maxwell Salzberg 2012-02-03 20:53:16 -08:00
commit 3bd9b0d62e

View file

@ -24,13 +24,13 @@ class RemovePublicShareVisibilities < ActiveRecord::Migration
while index < shareable_size + 100 do while index < shareable_size + 100 do
sql = <<-SQL sql = <<-SQL
DELETE sv DELETE
FROM share_visibilities AS sv FROM share_visibilities AS sv
INNER JOIN #{table_name} USING #{table_name} as p
ON sv.shareable_id = #{table_name}.id WHERE sv.shareable_id = p.id
WHERE sv.shareable_type = "#{type}" AND sv.shareable_type = '#{type}'
AND #{table_name}.public IS TRUE AND p.public IS TRUE
AND #{table_name}.id < #{index}; AND p.id < #{index};
SQL SQL
puts "deleted public share vis up to #{index} of #{type}" puts "deleted public share vis up to #{index} of #{type}"