Skip to content

Commit 0e43950

Browse files
committed
added travis
added bugfixes for 0.8
1 parent 63360ab commit 0e43950

File tree

6 files changed

+40
-12
lines changed

6 files changed

+40
-12
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
language: python
2+
before_script:
3+
- mysql -e 'create database testdb;'
4+
- psql -c 'create database testdb;' -U postgres
5+
python:
6+
- "2.7"
7+
# command to install dependencies
8+
install:
9+
- "pip install -r test-req.pip --use-mirrors"
10+
- "python setup.py develop"
11+
# command to run tests
12+
script: nosetests -v

README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

README renamed to README.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
sqlalchemy-migrate
2+
==================
3+
4+
Fork from http://code.google.com/p/sqlalchemy-migrate/ to get it working with
5+
SQLAlchemy 0.8.
6+
17
Inspired by Ruby on Rails' migrations, Migrate provides a way to deal with
28
database schema changes in `SQLAlchemy <http://sqlalchemy.org>`_ projects.
39

@@ -6,7 +12,7 @@ database change repository mechanism which can be used from the command line as
612
well as from inside python code.
713

814
Help
9-
------
15+
----
1016

1117
Sphinx documentation is available at the project page `packages.python.org
1218
<http://packages.python.org/sqlalchemy-migrate/>`_.
@@ -28,7 +34,7 @@ You can also clone a current `development version
2834
project's `mercurial <http://mercurial.selenic.com/>`_ trunk.
2935

3036
Tests and Bugs
31-
------------------
37+
--------------
3238

3339
To run automated tests:
3440

migrate/changeset/ansisql.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Index)
1818

1919
from migrate import exceptions
20+
import sqlalchemy.sql.compiler
2021
from migrate.changeset import constraint
2122

2223
from sqlalchemy.schema import AddConstraint, DropConstraint
@@ -153,6 +154,19 @@ class ANSISchemaChanger(AlterTableVisitor, SchemaGenerator):
153154
name. NONE means the name is unchanged.
154155
"""
155156

157+
def _index_identifier(self, ident):
158+
"""This function is move in 0.8 to _prepared_index_name"""
159+
if isinstance(ident, sqlalchemy.sql.compiler.sql._truncated_label):
160+
max = self.dialect.max_index_name_length or \
161+
self.dialect.max_identifier_length
162+
if len(ident) > max:
163+
ident = ident[0:max - 8] + \
164+
"_" + sqlalchemy.sql.compiler.util.md5_hex(ident)[-4:]
165+
else:
166+
self.dialect.validate_identifier(ident)
167+
168+
return ident
169+
156170
def visit_table(self, table):
157171
"""Rename a table. Other ops aren't supported."""
158172
self.start_alter_table(table)

test-req.pip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ scripttest==1.0
66
pytz
77
psycopg2
88
pysqlite
9-
mysql-python
10-
http://jenkins.gnuviech-server.de/userContent/kinterbasdb-3.3.0.tar.bz2
9+
#mysql-python
10+
#http://jenkins.gnuviech-server.de/userContent/kinterbasdb-3.3.0.tar.bz2
1111
virtualenv
1212
unittest2

test_db.cfg.tmpl renamed to test_db.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# The string '__tmp__' is substituted for a temporary file in each connection
99
# string. This is useful for sqlite tests.
1010
sqlite:///__tmp__
11-
postgresql://scott:tiger@localhost/test_migrate
12-
mysql://scott:tiger@localhost/test_migrate
13-
oracle://scott:tiger@localhost
14-
firebird://scott:tiger@localhost//var/lib/firebird/databases/test_migrate
11+
postgresql://postgres@localhost/testdb
12+
mysql://root@localhost/testdb
13+
#oracle://scott:tiger@localhost
14+
#firebird://scott:tiger@localhost//var/lib/firebird/databases/test_migrate

0 commit comments

Comments
 (0)