[copr] master: Don't alter varchar columns on sqlite (fcd43b8)

bkabrda at fedorahosted.org bkabrda at fedorahosted.org
Wed Jan 9 07:51:34 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit fcd43b83a30cb24af42e25ff71825cc4f53050a9
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Wed Jan 9 08:48:49 2013 +0100

    Don't alter varchar columns on sqlite


>---------------------------------------------------------------

 .../versions/2e30169e58ce_change_api_token_len.py  |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/coprs_frontend/alembic/versions/2e30169e58ce_change_api_token_len.py b/coprs_frontend/alembic/versions/2e30169e58ce_change_api_token_len.py
index 14b2708..2e8c9bf 100644
--- a/coprs_frontend/alembic/versions/2e30169e58ce_change_api_token_len.py
+++ b/coprs_frontend/alembic/versions/2e30169e58ce_change_api_token_len.py
@@ -18,11 +18,13 @@ def upgrade():
     """ Change the api_token field from the user table from varchar(40) to
     varchar(255).
     """
-    op.alter_column("user", "api_token", type_=sa.String(255))
+    if op.get_bind().dialect.name != 'sqlite':
+        op.alter_column("user", "api_token", type_=sa.String(255))
 
 
 def downgrade():
     """ Change the api_token field from the user table from varchar(255) to
     varchar(40).
     """
-    op.alter_column("user", "api_token", type_=sa.String(40))
+    if op.get_bind().dialect.name != 'sqlite':
+        op.alter_column("user", "api_token", type_=sa.String(40))



More information about the copr-devel mailing list