Mailinglist Archive: opensuse-buildservice (123 mails)

< Previous Next >
[opensuse-buildservice] Re: Proposal to use data_migrate gem for API
Just for the record, we've agreed in a meeting that we will keep database structure migrations separate from database content migrations, the latter of which will be handled by the data_migrate gem. This means that we will need to run `rake db:migrate:with_data` instead of just `rake db:migrate` so we will need to update the appliance to run that command too.


On 04/09/17 11:13, Evan Rolfe wrote:

Proposal to use data_migrate gem for API

Hi all, I would like to propose that we use the data_migrate <https://github.com/ilyakatz/data-migrate> gem to handle changes to db data. Here is a PR <https://github.com/openSUSE/open-build-service/pull/3701>
I have opened where I need to update each notification's event_payload from YAML to JSON serialisation. This
doesn't make sense to do in a normal migration because it has nothing to do with database structure only the
content of the database. This gem allows us to handle such changes in the same way we handle normal
migrations.

The alternative is to use rake tasks for data changes which is what I initially did in the PR in this commit <https://github.com/openSUSE/open-build-service/pull/3701/commits/f2c9ef6a65c2b9930976b25cff7c07e0002a440a>.

However the downsides of that are that we need to always update the README's to let updaters know exactly
which rake tasks need to be run to update their db and it also makes it easier to sync data changes with
other developers. All thats needed to get your database up to date with the gem is to run `rake db:migrate:with_data`.

If you have any opinions please post on the PR to continue this discussion.

Thanks


--
Evan Rolfe
Full Stack Web Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755;https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)

--
Evan Rolfe
Full Stack Web Developer
SUSE Linux GmbH, Maxfeldstr. 5, D-90409 Nürnberg
Tel: +49-911-74053-0; Fax: +49-911-7417755; https://www.suse.com/
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard,
Graham Norton, HRB 21284 (AG Nürnberg)

< Previous Next >
References