case MsSql.ID:
return format("NVARCHAR (%d)", columnSize);
case Oracle.ID:
- return format("VARCHAR (%d%s)", columnSize, ignoreOracleUnit ? "" : " CHAR");
+ return format("VARCHAR2 (%d%s)", columnSize, ignoreOracleUnit ? "" : " CHAR");
default:
return format("VARCHAR (%d)", columnSize);
}
assertThat(def.generateSqlType(new PostgreSql())).isEqualTo("VARCHAR (10)");
assertThat(def.generateSqlType(new MySql())).isEqualTo("VARCHAR (10)");
assertThat(def.generateSqlType(new MsSql())).isEqualTo("NVARCHAR (10)");
- assertThat(def.generateSqlType(new Oracle())).isEqualTo("VARCHAR (10 CHAR)");
+ assertThat(def.generateSqlType(new Oracle())).isEqualTo("VARCHAR2 (10 CHAR)");
}
@Test
.setIgnoreOracleUnit(true)
.build();
- assertThat(def.generateSqlType(new Oracle())).isEqualTo("VARCHAR (10)");
+ assertThat(def.generateSqlType(new Oracle())).isEqualTo("VARCHAR2 (10)");
}
@Test
@Test
public void add_columns_on_oracle() {
assertThat(createSampleBuilder(new Oracle()).build())
- .isEqualTo("ALTER TABLE issues ADD (date_in_ms NUMBER (38) NULL, name VARCHAR (10 CHAR) NOT NULL, col_with_default NUMBER(1) DEFAULT 0 NOT NULL, varchar_col_with_default VARCHAR (3 CHAR) DEFAULT 'foo' NOT NULL)");
+ .isEqualTo("ALTER TABLE issues ADD (date_in_ms NUMBER (38) NULL, name VARCHAR2 (10 CHAR) NOT NULL, col_with_default NUMBER(1) DEFAULT 0 NOT NULL, varchar_col_with_default VARCHAR2 (3 CHAR) DEFAULT 'foo' NOT NULL)");
}
@Test
assertThat(createSampleBuilder(new Oracle()).build())
.containsOnly(
"ALTER TABLE issues MODIFY (value NUMERIC (30,20) NULL)",
- "ALTER TABLE issues MODIFY (name VARCHAR (10 CHAR) NULL)");
+ "ALTER TABLE issues MODIFY (name VARCHAR2 (10 CHAR) NULL)");
}
@Test
public void update_not_nullable_column_on_oracle() {
assertThat(createNotNullableBuilder(new Oracle()).build())
- .containsOnly("ALTER TABLE issues MODIFY (name VARCHAR (10 CHAR) NOT NULL)");
+ .containsOnly("ALTER TABLE issues MODIFY (name VARCHAR2 (10 CHAR) NOT NULL)");
}
@Test
@Test
public void build_adds_DEFAULT_clause_on_varchar_column_on_Oracle() {
- verifyDefaultClauseOnVarcharColumn(ORACLE, "CREATE TABLE table_42 (status VARCHAR (1 CHAR) DEFAULT 'P' NOT NULL)");
+ verifyDefaultClauseOnVarcharColumn(ORACLE, "CREATE TABLE table_42 (status VARCHAR2 (1 CHAR) DEFAULT 'P' NOT NULL)");
}
@Test