Skip to content

Commit ea2ed1a

Browse files
committed
Fix bug: NULL description on cloned trees.
[refs #70468220]
1 parent b977af0 commit ea2ed1a

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

conf/evolutions/default/62.sql

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --- !Ups
2+
3+
BEGIN;
4+
5+
UPDATE tree SET description = '' WHERE description IS NULL;
6+
7+
ALTER TABLE tree ALTER COLUMN description SET NOT NULL;
8+
9+
COMMIT;
10+
11+
# --- !Downs
12+
13+
BEGIN;
14+
15+
ALTER TABLE tree ALTER COLUMN description DROP NOT NULL;
16+
17+
COMMIT;

worker/src/main/scala/org/overviewproject/clone/TreeCloner.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ object TreeCloner extends InDatabaseCloner {
77
override def cloneQuery: SqlQuery =
88
SQL("""
99
INSERT INTO tree (id, document_set_id, title, document_count, lang, supplied_stop_words,
10-
important_words, created_at)
10+
important_words, description, created_at)
1111
SELECT ({cloneDocumentSetId} << 32) | ({documentSetIdMask} & id), {cloneDocumentSetId}, title, document_count, lang, supplied_stop_words,
12-
important_words, created_at
12+
important_words, description, created_at
1313
FROM tree WHERE document_set_id = {sourceDocumentSetId}
1414
""")
15-
}
15+
}

0 commit comments

Comments
 (0)