mirror of
https://github.com/google/nomulus
synced 2026-01-06 21:47:31 +00:00
Add indexes on domainRepoId to DomainHistoryHost and PollMessage (#2380)
* Add index for domainRepoId to PollMessage and DomainHistoryHost * Add flyway fix for Concurrent * fix gradle.properties * Modify lockfiles * Update the release tool and add IF NOT EXISTS * Test removing transactional lock from deploy script * Add transactional lock flag to actual flyway commands in script * Remove flag from info command * Add configuration for integration test
This commit is contained in:
@@ -17,6 +17,7 @@ import java.util.Optional
|
||||
|
||||
plugins {
|
||||
id 'java-library'
|
||||
id "org.flywaydb.flyway" version "10.8.1"
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
@@ -317,6 +318,7 @@ dependencies {
|
||||
|
||||
// Flyway classes needed to generate the golden file.
|
||||
implementation deps['org.flywaydb:flyway-core']
|
||||
implementation deps['org.flywaydb:flyway-database-postgresql']
|
||||
|
||||
closureCompiler deps['com.google.javascript:closure-compiler']
|
||||
}
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
# This is a Gradle generated file for dependency locking.
|
||||
# Manual edits can break the build and are not advised.
|
||||
# This file is expected to be part of source control.
|
||||
empty=classpath
|
||||
com.fasterxml.jackson.core:jackson-annotations:2.15.2=classpath
|
||||
com.fasterxml.jackson.core:jackson-core:2.15.2=classpath
|
||||
com.fasterxml.jackson.core:jackson-databind:2.15.2=classpath
|
||||
com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.15.2=classpath
|
||||
com.fasterxml.jackson:jackson-bom:2.15.2=classpath
|
||||
com.google.code.gson:gson:2.10.1=classpath
|
||||
gradle.plugin.org.flywaydb:gradle-plugin-publishing:10.8.1=classpath
|
||||
org.flywaydb.flyway:org.flywaydb.flyway.gradle.plugin:10.8.1=classpath
|
||||
org.flywaydb:flyway-core:10.8.1=classpath
|
||||
empty=
|
||||
|
||||
@@ -407,7 +407,7 @@ org.eclipse.jetty:jetty-session:12.0.7=testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-util:12.0.7=testCompileClasspath,testRuntimeClasspath
|
||||
org.eclipse.jetty:jetty-xml:12.0.7=testCompileClasspath,testRuntimeClasspath
|
||||
org.flywaydb:flyway-core:10.10.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.flywaydb:flyway-database-postgresql:10.10.0=testRuntimeClasspath
|
||||
org.flywaydb:flyway-database-postgresql:10.10.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.glassfish.jaxb:jaxb-runtime:2.3.1=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.glassfish.jaxb:txw2:2.3.1=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.gwtproject:gwt-user:2.10.0=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
@@ -482,7 +482,7 @@ org.ow2.asm:asm:7.0=soy
|
||||
org.ow2.asm:asm:9.2=compileClasspath,nonprodCompileClasspath
|
||||
org.ow2.asm:asm:9.6=deploy_jar,jacocoAnt,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.pcollections:pcollections:3.1.4=annotationProcessor,errorprone,nonprodAnnotationProcessor,testAnnotationProcessor
|
||||
org.postgresql:postgresql:42.7.3=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.postgresql:postgresql:42.7.2=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.reflections:reflections:0.10.2=checkstyle
|
||||
org.rnorth.duct-tape:duct-tape:1.0.8=compileClasspath,deploy_jar,nonprodCompileClasspath,nonprodRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
|
||||
org.seleniumhq.selenium:selenium-api:3.141.59=testCompileClasspath,testRuntimeClasspath
|
||||
|
||||
@@ -91,11 +91,13 @@ public class DomainHistory extends HistoryEntry {
|
||||
@ElementCollection
|
||||
@JoinTable(
|
||||
name = "DomainHistoryHost",
|
||||
indexes =
|
||||
@Index(
|
||||
columnList =
|
||||
"domain_history_history_revision_id,domain_history_domain_repo_id,host_repo_id",
|
||||
unique = true))
|
||||
indexes = {
|
||||
@Index(columnList = "domain_history_domain_repo_id"),
|
||||
@Index(
|
||||
columnList =
|
||||
"domain_history_history_revision_id,domain_history_domain_repo_id,host_repo_id",
|
||||
unique = true)
|
||||
})
|
||||
@Column(name = "host_repo_id")
|
||||
Set<VKey<Host>> nsHosts;
|
||||
|
||||
|
||||
@@ -86,7 +86,12 @@ import org.joda.time.DateTime;
|
||||
@ExternalMessagingName("message")
|
||||
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
|
||||
@DiscriminatorColumn(name = "type")
|
||||
@Table(indexes = {@Index(columnList = "registrar_id"), @Index(columnList = "eventTime")})
|
||||
@Table(
|
||||
indexes = {
|
||||
@Index(columnList = "domainRepoId"),
|
||||
@Index(columnList = "registrar_id"),
|
||||
@Index(columnList = "eventTime")
|
||||
})
|
||||
public abstract class PollMessage extends ImmutableObject
|
||||
implements Buildable, TransferServerApproveEntity, UnsafeSerializable {
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.beust.jcommander.Parameters;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import org.flywaydb.core.Flyway;
|
||||
import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension;
|
||||
import org.testcontainers.containers.Container;
|
||||
|
||||
/**
|
||||
@@ -50,6 +51,10 @@ public class DumpGoldenSchemaCommand extends PostgresqlCommand {
|
||||
postgresContainer.getUsername(),
|
||||
postgresContainer.getPassword())
|
||||
.load();
|
||||
|
||||
PostgreSQLConfigurationExtension configurationExtension =
|
||||
flyway.getConfigurationExtension(PostgreSQLConfigurationExtension.class);
|
||||
configurationExtension.setTransactionalLock(false);
|
||||
flyway.migrate();
|
||||
|
||||
String userName = postgresContainer.getUsername();
|
||||
|
||||
Reference in New Issue
Block a user