Skip to content
Extraits de code Groupes Projets
Valider fe435d87 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Delete newly created disconnected notifications

parent 924dc13a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class DeleteDisconnectedNotifications < ActiveRecord::Migration
def self.up
result = execute("SELECT notifications.id FROM notifications
LEFT OUTER JOIN posts ON posts.id = notifications.target_id
WHERE posts.id IS NULL AND notifications.target_id IS NOT NULL AND notifications.target_type = 'Post'").to_a.flatten!
execute("DELETE FROM notifications WHERE notifications.id IN (#{result.join(',')})") if result
end
def self.down
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110317222802) do ActiveRecord::Schema.define(:version => 20110318012008) do
create_table "aspect_memberships", :force => true do |t| create_table "aspect_memberships", :force => true do |t|
t.integer "aspect_id", :null => false t.integer "aspect_id", :null => false
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter