MarginaliaSearch/code/common/db
Viktor Lofgren 47dfbacb00 (conf) Introduce a new concept of node profiles
Node profiles decide which actors are started, and which views are available in the control GUI.  This helps keep the system organized, and hides real-time clutter from the batch-oriented nodes.
2024-11-20 18:15:22 +01:00
..
java/nu/marginalia/db (chore) Remove lombok 2024-11-11 21:14:38 +01:00
resources/db/migration (conf) Introduce a new concept of node profiles 2024-11-20 18:15:22 +01:00
test/nu/marginalia/db (refac) Remove src/main from all source code paths. 2024-02-23 16:13:40 +01:00
build.gradle (build) Fix dependency churn from testcontainers 2024-08-25 10:35:48 +02:00
readme.md (docs) Begin un-fucking the docs after refactoring 2024-02-27 21:22:21 +01:00

DB

This module primarily contains SQL files for the URLs database. The most central tables are EC_DOMAIN, EC_URL and EC_PAGE_DATA.

Flyway

The system uses flyway to track database changes and allow easy migrations, this is accessible via gradle tasks.

  • flywayMigrate
  • flywayBaseline
  • flywayRepair
  • flywayClean (dangerous as in wipes your entire database)

Refer to the Flyway documentation for guidance. It's well documented and these are probably the only four tasks you'll ever need.

If you are not running the system via docker, you need to provide alternative connection details than the defaults (TODO: how?).

The migration files are in resources/db/migration. The file name convention incorporates the project's cal-ver versioning; and are applied in lexicographical order.

VYY_MM_v_nnn__description.sql

Central Paths

See Also

  • common/service implements DatabaseModule, which is from where the services get database connections.