Merge pull request #555 from ilvalle/bigint

Fix and initial tests for bigint
This commit is contained in:
mdipierro
2014-12-12 05:10:20 -06:00
2 changed files with 25 additions and 23 deletions
+2 -2
View File
@@ -105,8 +105,8 @@ class BaseAdapter(ConnectionPool):
'list:string': 'TEXT', 'list:string': 'TEXT',
'list:reference': 'TEXT', 'list:reference': 'TEXT',
# the two below are only used when DAL(...bigint_id=True) and replace 'id','reference' # the two below are only used when DAL(...bigint_id=True) and replace 'id','reference'
'big-id': 'BIGINT PRIMARY KEY AUTOINCREMENT', 'big-id': 'INTEGER PRIMARY KEY AUTOINCREMENT',
'big-reference': 'BIGINT REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s', 'big-reference': 'INTEGER REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s',
'reference FK': ', CONSTRAINT "FK_%(constraint_name)s" FOREIGN KEY (%(field_name)s) REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s', 'reference FK': ', CONSTRAINT "FK_%(constraint_name)s" FOREIGN KEY (%(field_name)s) REFERENCES %(foreign_key)s ON DELETE %(on_delete_action)s',
} }
+3 -1
View File
@@ -42,6 +42,7 @@ ALLOWED_DATATYPES = [
'upload', 'upload',
'password', 'password',
'json', 'json',
'bigint'
] ]
IS_POSTGRESQL = 'postgres' in DEFAULT_URI IS_POSTGRESQL = 'postgres' in DEFAULT_URI
@@ -622,7 +623,8 @@ class TestMigrations(unittest.TestCase):
class TestReference(unittest.TestCase): class TestReference(unittest.TestCase):
def testRun(self): def testRun(self):
db = DAL(DEFAULT_URI, check_reserved=['all']) for b in [True, False]:
db = DAL(DEFAULT_URI, check_reserved=['all'], bigint_id=b)
if DEFAULT_URI.startswith('mssql'): if DEFAULT_URI.startswith('mssql'):
#multiple cascade gotcha #multiple cascade gotcha
for key in ['reference','reference FK']: for key in ['reference','reference FK']: