tarantool / migrations

BSD 2-Clause "Simplified" License
21 stars 5 forks source link

Ability to execute migration only once on the single node of a cluster #43

Open vrogach2020 opened 3 years ago

vrogach2020 commented 3 years ago

Now all migrations will execute on each node of the cluster.

I want to insert some initial data to some sharded space in a cluster (constants, configs etc). For example consider the following migration code:


return {
    up = function()

        crud.insert('dictionary', {1, box.NULL, 'en_ru', 'apple', 'яблоко'})
        crud.insert('dictionary', {2, box.NULL, 'en_ru', 'tomato', 'томат'})

        return true
    end,

    run_on_single_node = true
}

It seems that if such migration completes without errors it must be marked as 'EXECUTED' on all nodes.