From 009ad985a008fce0de93efe35be3995229a5b303 Mon Sep 17 00:00:00 2001 From: "Ray J. Greenwell" Date: Thu, 7 May 2015 13:19:11 -0700 Subject: [PATCH] Fix postgres for migrating a generated id int column to long. --- .../com/samskivert/depot/impl/jdbc/PostgreSQLLiaison.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/samskivert/depot/impl/jdbc/PostgreSQLLiaison.java b/src/main/java/com/samskivert/depot/impl/jdbc/PostgreSQLLiaison.java index 30f1353..f249962 100644 --- a/src/main/java/com/samskivert/depot/impl/jdbc/PostgreSQLLiaison.java +++ b/src/main/java/com/samskivert/depot/impl/jdbc/PostgreSQLLiaison.java @@ -82,6 +82,12 @@ public class PostgreSQLLiaison extends BaseLiaison Boolean nullable, Boolean unique, String defaultValue) throws SQLException { + // We can create a column as "BIGSERIAL" but when changing we need to say "BIGINT". + // TODO: does this handle all cases? + if ("BIGSERIAL".equalsIgnoreCase(type)) { + type = "BIGINT"; + } + StringBuilder lbuf = new StringBuilder(); if (type != null) { executeQuery(