use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class BigIntegerColumnDefTest method generate_sql_type.
@Test
public void generate_sql_type() throws Exception {
BigIntegerColumnDef def = new BigIntegerColumnDef.Builder().setColumnName("issues").setIsNullable(true).build();
assertThat(def.generateSqlType(new H2())).isEqualTo("BIGINT");
assertThat(def.generateSqlType(new PostgreSql())).isEqualTo("BIGINT");
assertThat(def.generateSqlType(new MsSql())).isEqualTo("BIGINT");
assertThat(def.generateSqlType(new MySql())).isEqualTo("BIGINT");
assertThat(def.generateSqlType(new Oracle())).isEqualTo("NUMBER (38)");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropSnapshotIdColumnFromCeActivityTest method verify_generated_sql_on_postgresql.
@Test
public void verify_generated_sql_on_postgresql() throws SQLException {
when(database.getDialect()).thenReturn(new PostgreSql());
DdlChange.Context context = mock(DdlChange.Context.class);
underTest.execute(context);
verify(context).execute("ALTER TABLE ce_activity DROP COLUMN snapshot_id");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropSnapshotIdColumnFromEventsTest method verify_generated_sql_on_postgresql.
@Test
public void verify_generated_sql_on_postgresql() throws SQLException {
when(database.getDialect()).thenReturn(new PostgreSql());
DdlChange.Context context = mock(DdlChange.Context.class);
underTest.execute(context);
verify(context).execute("ALTER TABLE events DROP COLUMN snapshot_id");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropSnapshotIdColumnFromMeasuresTest method verify_generated_sql_on_postgresql.
@Test
public void verify_generated_sql_on_postgresql() throws SQLException {
when(database.getDialect()).thenReturn(new PostgreSql());
DdlChange.Context context = mock(DdlChange.Context.class);
underTest.execute(context);
verify(context).execute("ALTER TABLE project_measures DROP COLUMN snapshot_id");
}