comparison roundup/backends/back_postgresql.py @ 6599:39189dd94f2c

issue2551189 - increase size of words in full text index. Increased indexed word maxlength to 50 DB migration code is written and tests work. Restructured some tests to allow for code reuse. Docs. If this passes CI without errors 2551189 should be done. However, testing on my system generates errors. Encoding (indexer unicode russian unicode string invalid) and collation errors (utf8_bin not valid) when running under python2. No issues with python3 and I haven't changed code that should cause these since the last successful build in CI. So if this fails in CI we will have more checkins.
author John Rouillard <rouilj@ieee.org>
date Wed, 26 Jan 2022 15:04:09 -0500
parents e70e2789bc2c
children 0d99ae7c8de6
comparison
equal deleted inserted replaced
6598:27a4ab499189 6599:39189dd94f2c
262 def fix_version_3_tables(self): 262 def fix_version_3_tables(self):
263 rdbms_common.Database.fix_version_3_tables(self) 263 rdbms_common.Database.fix_version_3_tables(self)
264 self.sql('''CREATE INDEX words_both_idx ON public.__words 264 self.sql('''CREATE INDEX words_both_idx ON public.__words
265 USING btree (_word, _textid)''') 265 USING btree (_word, _textid)''')
266 266
267 def fix_version_6_tables(self):
268 # Modify length for __words._word column.
269 c = self.cursor
270 sql = 'alter table __words alter column _word type varchar(%s)' % (
271 self.arg)
272 # Why magic number 5? It was the original offset between
273 # column length and maxlength.
274 c.execute(sql, (self.indexer.maxlength + 5,))
275
267 def add_actor_column(self): 276 def add_actor_column(self):
268 # update existing tables to have the new actor column 277 # update existing tables to have the new actor column
269 tables = self.database_schema['tables'] 278 tables = self.database_schema['tables']
270 for name in tables: 279 for name in tables:
271 self.sql('ALTER TABLE _%s add __actor VARCHAR(255)'%name) 280 self.sql('ALTER TABLE _%s add __actor VARCHAR(255)'%name)

Roundup Issue Tracker: http://roundup-tracker.org/