Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
commit e3e5065c9e564f8a8016970cf70c8cbce2c4ba8a Author: Bohuslav Kabrda bkabrda@redhat.com Date: Wed Feb 20 11:18:05 2013 +0100
Now that sql_custom module doesn't exist, mock it's behaviour in the old migration
.../versions/3a035889852c_add_copr_fulltext.py | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/coprs_frontend/alembic/versions/3a035889852c_add_copr_fulltext.py b/coprs_frontend/alembic/versions/3a035889852c_add_copr_fulltext.py index 8fa6a5e..674e06e 100644 --- a/coprs_frontend/alembic/versions/3a035889852c_add_copr_fulltext.py +++ b/coprs_frontend/alembic/versions/3a035889852c_add_copr_fulltext.py @@ -12,12 +12,23 @@ down_revision = '3c3cce7a5fe0'
from alembic import op import sqlalchemy as sa +from sqlalchemy import types +from sqlalchemy.ext import compiler
-from coprs import sql_custom +class Tsvector(types.UnicodeText): + pass + +@compiler.compiles(Tsvector, 'postgresql') +def compile_tsvector(element, compiler, **kw): + return 'tsvector' + +@compiler.compiles(Tsvector, 'sqlite') +def compile_tsvector(element, compiler, **kw): + return 'text'
def upgrade(): ### commands auto generated by Alembic - please adjust! ### - op.add_column('copr', sa.Column('copr_ts_col', sql_custom.Tsvector(), nullable=True)) + op.add_column('copr', sa.Column('copr_ts_col', Tsvector(), nullable=True)) op.create_index('copr_ts_idx', 'copr', ['copr_ts_col'], postgresql_using='gin')
session = sa.orm.sessionmaker(bind=op.get_bind())()
copr-devel@lists.fedorahosted.org