icingadb/internal
Alvar Penning 48d4305e92
Auto Import Database Schema
To get rid of docker-icingadb and its additional entry point, the schema
import functionality has been implemented directly in Icinga DB. Using
the new --database-auto-import command line argument will result in an
automatic schema import if no schema is found.

The implementation is split between the already existing CheckSchema
function and the introduced ImportSchema function.

The CheckSchema function is now able to distinguish between the absence
of a schema and an incorrect schema version. Both situations return a
separate error type.

As before, CheckSchema is called in the main function. If the error type
now implies the absence of a schema (ErrSchemaNotExists) and the
--database-auto-import flag is set, the auto-import is started.

The schema import itself is performed in the new ImportSchema function,
which loads the schema from a given file and inserts it within a
transaction, allowing to rollback in case of an error.

Fixes #896.
2025-03-28 10:39:16 +01:00
..
command Use config#Load from our library 2025-03-17 09:32:01 +01:00
config Auto Import Database Schema 2025-03-28 10:39:16 +01:00
version.go Release Icinga DB Version 1.2.1 2024-12-18 10:45:22 +01:00