From 4ed4c848b66bc5fdd42e05c8b8c726ace2c25704 Mon Sep 17 00:00:00 2001 From: Kaushik Chandrashekar Date: Thu, 7 Mar 2013 19:17:00 -0600 Subject: Compile BigInteger to INTEGER for sqlite Ensure BigInteger does not map to BIGINT for an auto-created sqlite registry DB, as this type is not supported by sqlite. Refactoring a test to use generic unsupported column type Fixes bug 1147879 Change-Id: I590c798dd470def286802bc6e00bb4b621332b8d --- nova/db/sqlalchemy/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'nova/db') diff --git a/nova/db/sqlalchemy/__init__.py b/nova/db/sqlalchemy/__init__.py index 747015af5..800f11071 100644 --- a/nova/db/sqlalchemy/__init__.py +++ b/nova/db/sqlalchemy/__init__.py @@ -15,3 +15,11 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +from sqlalchemy import BigInteger +from sqlalchemy.ext.compiler import compiles + + +@compiles(BigInteger, 'sqlite') +def compile_big_int_sqlite(type_, compiler, **kw): + return 'INTEGER' -- cgit