1:- module(bc_migrate, [
2 bc_migrate/3 3]).
11:- use_module(library(docstore)). 12:- use_module(library(debug)). 13
14:- meta_predicate(bc_migrate(+, +, 0)).
22bc_migrate(Name, Description, Goal):-
23 ( ds_find(migration, name=Name, [_])
24 -> true
25 ; Transaction = (Goal, bc_remember_migration(Name, Description)),
26 debug(bc_migrate, 'running migration ~p', [Name]),
27 ds_transactional(Transaction)).
33bc_remember_migration(Name, Description):-
34 ds_insert(migration{ name: Name, description: Description })
Handles data migrations for the underlying docstore database. Migrations are run in the order of bc_migrate/3 calls. */