Skip to content

Commit

Permalink
only cast NULL to an integer for postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Jul 30, 2011
1 parent ec0c040 commit 6b3dc39
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -21,8 +21,12 @@ def migrate_claims(migrate_engine, metadata, buildrequests, objects,
buildrequest_claims):

# First, ensure there is an object row for each master
null_id = sa.null().label('id')
if migrate_engine.dialect.name == 'postgresql':
# postgres needs NULL cast to an integer:
null_id = sa.cast(null_id, sa.INTEGER)
new_objects = sa.select([
sa.cast(sa.null().label('id'), sa.INTEGER),
null_id,
buildrequests.c.claimed_by_name.label("name"),
sa.literal_column("'BuildMaster'").label("class_name"),
],
Expand Down

0 comments on commit 6b3dc39

Please sign in to comment.