Skip to content

Commit

Permalink
Fix bug: NULL description on cloned trees.
Browse files Browse the repository at this point in the history
[refs #70468220]
  • Loading branch information
adamhooper committed May 28, 2014
1 parent b977af0 commit ea2ed1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions conf/evolutions/default/62.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --- !Ups

BEGIN;

UPDATE tree SET description = '' WHERE description IS NULL;

ALTER TABLE tree ALTER COLUMN description SET NOT NULL;

COMMIT;

# --- !Downs

BEGIN;

ALTER TABLE tree ALTER COLUMN description DROP NOT NULL;

COMMIT;
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ object TreeCloner extends InDatabaseCloner {
override def cloneQuery: SqlQuery =
SQL("""
INSERT INTO tree (id, document_set_id, title, document_count, lang, supplied_stop_words,
important_words, created_at)
important_words, description, created_at)
SELECT ({cloneDocumentSetId} << 32) | ({documentSetIdMask} & id), {cloneDocumentSetId}, title, document_count, lang, supplied_stop_words,
important_words, created_at
important_words, description, created_at
FROM tree WHERE document_set_id = {sourceDocumentSetId}
""")
}
}

0 comments on commit ea2ed1a

Please sign in to comment.