001package io.ebeaninternal.dbmigration.ddlgeneration.platform;
002
003import io.ebean.config.dbplatform.DatabasePlatform;
004
005public class Postgres9Ddl extends PostgresDdl {
006
007  public Postgres9Ddl(DatabasePlatform platform) {
008    super(platform);
009  }
010
011  /**
012   * Map bigint, integer and smallint into their equivalent serial types.
013   */
014  @Override
015  public String asIdentityColumn(String columnDefn, DdlIdentity identity) {
016    if ("bigint".equalsIgnoreCase(columnDefn)) {
017      return "bigserial";
018    }
019    if ("integer".equalsIgnoreCase(columnDefn)) {
020      return "serial";
021    }
022    if ("smallint".equalsIgnoreCase(columnDefn)) {
023      return "smallserial";
024    }
025    return columnDefn;
026  }
027}