From e024316d57d1b879bdedcc3c80d6583fd86a7b3c Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Fri, 12 Feb 2016 00:34:46 +0300 Subject: [PATCH] Split name column into 3 Most authors in the INP files have at least a surname, often a name, sometimes a middle name or a patronymic. --- m_librarian/db.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/m_librarian/db.py b/m_librarian/db.py index 395d667..6e08204 100755 --- a/m_librarian/db.py +++ b/m_librarian/db.py @@ -53,11 +53,14 @@ if connection.dbName == 'sqlite': class Author(SQLObject): - name = UnicodeCol(notNull=True, unique=True) + surname = UnicodeCol(notNull=True) + name = UnicodeCol(notNull=True) + misc_name = UnicodeCol(notNull=True) count = IntCol(notNull=True) books = RelatedJoin('Book', otherColumn='book_id', intermediateTable='author_book', createRelatedTable=False) + full_name_idx = DatabaseIndex(surname, name, misc_name, unique=True) count_idx = DatabaseIndex(count) -- 2.39.5