Correct type is NUMBER(38,0) but not INTEGER
Signed-off-by: Simon Brandhof <simon.brandhof@sonarsource.com>
public String generateSqlType(Dialect dialect) {
switch (dialect.getId()) {
case PostgreSql.ID:
- case Oracle.ID:
case MySql.ID:
case H2.ID:
return "INTEGER";
case MsSql.ID:
return "INT";
+ case Oracle.ID:
+ return "NUMBER(38,0)";
default:
throw new IllegalArgumentException("Unsupported dialect id " + dialect.getId());
}
.build();
assertThat(stmts).hasSize(3);
assertThat(stmts.get(0))
- .isEqualTo("CREATE TABLE table_42 (id INTEGER NOT NULL, CONSTRAINT pk_table_42 PRIMARY KEY (id))");
+ .isEqualTo("CREATE TABLE table_42 (id NUMBER(38,0) NOT NULL, CONSTRAINT pk_table_42 PRIMARY KEY (id))");
assertThat(stmts.get(1))
.isEqualTo("CREATE SEQUENCE table_42_seq START WITH 1 INCREMENT BY 1");
assertThat(stmts.get(2))
@Test
public void generateSqlType_for_Oracle() {
- assertThat(underTest.generateSqlType(new Oracle())).isEqualTo("INTEGER");
+ assertThat(underTest.generateSqlType(new Oracle())).isEqualTo("NUMBER(38,0)");
}
@Test