use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropIdColumnsFromSnapshotsTest 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 snapshots DROP COLUMN project_id, DROP COLUMN root_project_id");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropProjectIdColumnFromMeasuresTest 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 project_id");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropRememberMeColumnsFromUsersTest 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 users DROP COLUMN remember_token, DROP COLUMN remember_token_expires_at");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropIndexBuilderTest method drop_index_in_table.
@Test
public void drop_index_in_table() {
verifySql(new H2(), "DROP INDEX IF EXISTS issues_key");
verifySql(new MsSql(), "DROP INDEX issues_key ON issues");
verifySql(new MySql(), "DROP INDEX issues_key ON issues");
verifySql(new Oracle(), "DROP INDEX issues_key");
verifySql(new PostgreSql(), "DROP INDEX IF EXISTS issues_key");
}
use of org.sonar.db.dialect.PostgreSql in project sonarqube by SonarSource.
the class DropTableBuilderTest method fail_when_table_is_null.
@Test
public void fail_when_table_is_null() throws Exception {
expectedException.expect(NullPointerException.class);
new DropTableBuilder(new PostgreSql(), null);
}