summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrate/20170516153305_migrate_assignee_to_separate_table.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb b/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb
index f269ca7fc34..eed9f00d8b2 100644
--- a/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb
+++ b/db/migrate/20170516153305_migrate_assignee_to_separate_table.rb
@@ -47,7 +47,7 @@ class MigrateAssigneeToSeparateTable < ActiveRecord::Migration
RETURNS trigger AS
$BODY$
BEGIN
- if OLD.assignee_id IS NOT NULL THEN
+ if OLD IS NOT NULL AND OLD.assignee_id IS NOT NULL THEN
DELETE FROM issue_assignees WHERE issue_id = OLD.id;
END IF;