|
21 | 21 | -export_type([schema/0]). |
22 | 22 |
|
23 | 23 | -define(DB_REF, bender). |
| 24 | +-define(DEFAULT_MIGRATION_OPTS, [{batch_size, 5000}]). |
24 | 25 |
|
25 | 26 | %% API |
26 | 27 |
|
@@ -163,6 +164,11 @@ db_init(machinery) -> |
163 | 164 | ok. |
164 | 165 |
|
165 | 166 | db_init(MigrationsDir, DbOpts) -> |
166 | | - {ok, _} = epg_migrator:perform("generator", DbOpts, [], filename:join([MigrationsDir, "generator"])), |
167 | | - {ok, _} = epg_migrator:perform("sequence", DbOpts, [], filename:join([MigrationsDir, "sequence"])), |
| 167 | + MigrationOpts = application:get_env(bender, migration_opts, ?DEFAULT_MIGRATION_OPTS), |
| 168 | + logger:info("migrations for generator start"), |
| 169 | + {ok, _} = epg_migrator:perform("generator", DbOpts, MigrationOpts, filename:join([MigrationsDir, "generator"])), |
| 170 | + logger:info("migrations for generator success"), |
| 171 | + logger:info("migrations for sequence start"), |
| 172 | + {ok, _} = epg_migrator:perform("sequence", DbOpts, MigrationOpts, filename:join([MigrationsDir, "sequence"])), |
| 173 | + logger:info("migrations for sequence success"), |
168 | 174 | ok. |
0 commit comments