From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 6 Mar 2019 19:43:01 +0300 From: Vladimir Davydov Subject: Re: [PATCH v2] box: add on_schema_init trigger Message-ID: <20190306164300.aqwgdivl4ef5o7ty@esperanza> References: <20190305155309.32516-1-sergepetrenko@tarantool.org> <20190305185906.GC7992@chai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190305185906.GC7992@chai> To: Konstantin Osipov Cc: Serge Petrenko , tarantool-patches@freelists.org List-ID: On Tue, Mar 05, 2019 at 09:59:06PM +0300, Konstantin Osipov wrote: > * Serge Petrenko [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.