migrating
On this page:
- spider.migrating: Whether this run is
spider migrate(SPIDER_MIGRATEset): listen() then applies the migrations and returns without serving. An app whose main() does work before listen() that migrating does not need (an identity provider, a cache) migrates first and returns:
spider.migrating
pub fn migrating() bool
Whether this run is spider migrate (SPIDER_MIGRATE set): listen() then applies the migrations and returns without serving. An app whose main() does work before listen() that migrating does not need (an identity provider, a cache) migrates first and returns:
try spider.pg.init(allocator, io, .{});
if (spider.migrating()) {
var server = spider.app(.{});
defer server.deinit();
return server.mountModules(.{notify}).migrations(app_migrations.all).listen(.{});
}