Skip to content

Commit 1bc1828

Browse files
authored
Use JSON fixtures instead of SQL migrations in development profile (#790)
* remove dev sql migrations (most of these have been moved into the json fixtures, except for some users, saved queries, and dev settings) * adapt application-development.yml to bootstrap from fixtures instead of the sql migrations from resources/dev/db/migration * temporary quick-fix to make sure rdf migrations run after postgres bootstrap from fixtures (rdf migrations will be handled in an upcoming PR)
1 parent ca929b4 commit 1bc1828

7 files changed

Lines changed: 7 additions & 753 deletions

File tree

src/main/java/org/fairdatapoint/database/rdf/migration/RdfDevelopmentMigrationRunner.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
package org.fairdatapoint.database.rdf.migration;
2424

25-
import jakarta.annotation.PostConstruct;
2625
import org.fairdatapoint.Profiles;
2726
import org.fairdatapoint.database.rdf.migration.development.metadata.AclMigration;
2827
import org.fairdatapoint.database.rdf.migration.development.metadata.RdfMetadataMigration;
@@ -32,7 +31,9 @@
3231
import org.springframework.beans.factory.annotation.Autowired;
3332
import org.springframework.beans.factory.annotation.Qualifier;
3433
import org.springframework.beans.factory.annotation.Value;
34+
import org.springframework.boot.context.event.ApplicationReadyEvent;
3535
import org.springframework.context.annotation.Profile;
36+
import org.springframework.context.event.EventListener;
3637
import org.springframework.stereotype.Service;
3738

3839
@Service
@@ -52,7 +53,7 @@ public class RdfDevelopmentMigrationRunner {
5253
@Qualifier("genericMetadataRepository")
5354
private GenericMetadataRepository metadataRepository;
5455

55-
@PostConstruct
56+
@EventListener(ApplicationReadyEvent.class)
5657
public void run() {
5758
rdfMetadataMigration.runMigration();
5859
if (activeProfile.equals(Profiles.DEVELOPMENT)) {

src/main/resources/application-development.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ spring:
1212
username: fdp
1313
password: fdp
1414
flyway:
15-
locations: classpath:dev/db/migration,classpath:db/migration
15+
locations: classpath:db/migration
1616
fail-on-missing-locations: true
1717
clean-disabled: false
18+
19+
bootstrap:
20+
enabled: true

src/main/resources/dev/db/migration/V0001.1__dev-data-users.sql

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)