From 39f1bb4cae1b62b3a360a29202477829808357b0 Mon Sep 17 00:00:00 2001 From: 1aerostorm Date: Sun, 12 Nov 2023 00:45:34 +0000 Subject: [PATCH] Tarantool migrations --- db/app.lua | 4 +++- db/reg_pollers.lua | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/db/app.lua b/db/app.lua index 7cc8e18..112622b 100644 --- a/db/app.lua +++ b/db/app.lua @@ -92,5 +92,7 @@ box.once('bootstrap', function() oauth_bootstrap() server_tokens_bootstrap() cryptostore_bootstrap() - reg_pollers_bootstrap() end) + +print('applying migrations...') +reg_pollers_migration_v1() diff --git a/db/reg_pollers.lua b/db/reg_pollers.lua index 6d6ce75..01420c2 100644 --- a/db/reg_pollers.lua +++ b/db/reg_pollers.lua @@ -1,6 +1,9 @@ fiber = require 'fiber' -function reg_pollers_bootstrap() +function reg_pollers_migration_v1() + if box.space.reg_pollers ~= nil then + return + end box.schema.sequence.create('reg_pollers') reg_pollers = box.schema.create_space('reg_pollers', { format = {