[PATCH v2] box: add on_schema_init trigger

Vladimir Davydov vdavydov.dev at gmail.com
Wed Mar 6 19:43:01 MSK 2019


On Tue, Mar 05, 2019 at 09:59:06PM +0300, Konstantin Osipov wrote:
> * Serge Petrenko <sergepetrenko at tarantool.org> [19/03/05 18:57]:
> > If you want to change space's `space_name` storage engine to `vinyl`
> > , you may say:
> > ```
> > function trig(old, new)
> >     if new[3] == 'space_name' and new[4] ~= 'vinyl' then
> >         return box.tuple.new{new[1], new[2], new[3], 'vinyl',
> >                              new[5], new[6], new[7]}
> >     end
> > end
> > ```
> 
> Please access tuple fields by their names ;)

Unfortunately, we can't - formats are not set in schema_init(), they are
recovered from the snapshot. Probably, we can fix that.



More information about the Tarantool-patches mailing list