Bug 5837 - Change installer to use DBIx::Class::Schema::Versioned instead of updatedatabase.pl
Summary: Change installer to use DBIx::Class::Schema::Versioned instead of updatedatab...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement with 10 votes (vote)
Assignee: Chris Cormack
QA Contact: Bugs List
URL:
Keywords:
Depends on: 8798
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-07 02:19 UTC by Chris Cormack
Modified: 2019-05-04 12:08 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2011-03-07 02:19:12 UTC
In order to move us one step closer to database independence we should move to using a db independent schema. DBIx::Class::Schema gives us this. 

If we use DBIx::Class::Schema::Versioned we can do away with both kohastructure.sql and updatedatabase.pl
Comment 2 Kyle M Hall 2012-05-23 14:29:58 UTC
What's the status on this? I'd love to see this in Koha proper.
Comment 3 Kyle M Hall 2012-05-23 16:14:46 UTC
DBIx::Class::DeploymentHandler would be another alternative to Versioned.
Comment 4 Chris Cormack 2012-05-23 23:36:21 UTC
(In reply to comment #3)
> DBIx::Class::DeploymentHandler would be another alternative to Versioned.

Not without Moose it wouldn't. Versioned is a much  more lightweight tool, and doesn't depend on installing every perl module in the entire world, which Moose seems to want to do. :)

Short version this is stalled, I had a schema built, that I deployed to both postgres and mysql successfully. The code remains in a git branch, but then I crazily volunteered to be RM, and now RMaint .. and so haven't any time to devote to it. 

https://gitorious.org/koha/mainline/trees/dbix_class/lib/Koha/Schema 

I think working on this instead of poking at ` would be a much better use of someone's time :)
Comment 5 David Cook 2014-11-27 23:10:30 UTC
(In reply to Chris Cormack from comment #4)
> (In reply to comment #3)
> > DBIx::Class::DeploymentHandler would be another alternative to Versioned.
> 
> Not without Moose it wouldn't. Versioned is a much  more lightweight tool,
> and doesn't depend on installing every perl module in the entire world,
> which Moose seems to want to do. :)
> 
> Short version this is stalled, I had a schema built, that I deployed to both
> postgres and mysql successfully. The code remains in a git branch, but then
> I crazily volunteered to be RM, and now RMaint .. and so haven't any time to
> devote to it. 
> 
> https://gitorious.org/koha/mainline/trees/dbix_class/lib/Koha/Schema 
> 
> I think working on this instead of poking at ` would be a much better use of
> someone's time :)

I wouldn't say I'm working on this, but when I have free time here and there, I've been finding and solving the problems that stand in the way of using DBIx::Class for deploying and upgrading our DB schema.

I have a few minor details to work on in terms of getting the schema to deploy the way we have it currently, but the biggest obstacle I'm facing is DBIx::Class::Schema::Loader. I think some changes might have to be done by hand to the DBIC Result classes themselves. 

I'm going to investigate that further though.

In any case...

I also think DBIx::Class::DeploymentHandler is probably too heavy, but I'm not 100% sure that DBIx::Class::Schema::Versioned will provide all we need either. Since it's just a module, we'll need an update script of some kind anyway. We'll also need a way of inserting data (for system preference, for example) and not just doing schema structure changes which DCSV is meant for.

Anyway, yep, it's certainly on my mind... poking a lot at this on http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11390
Comment 6 Olli-Antti Kivilahti 2015-09-09 09:53:44 UTC
Hi there!
Can you share the code you have been working on here as commits?
I am not asking for anything "git bz apply":able, just something to read your thoughts from.
Comment 7 David Cook 2015-09-13 23:30:37 UTC
(In reply to Olli-Antti Kivilahti from comment #6)
> Hi there!
> Can you share the code you have been working on here as commits?
> I am not asking for anything "git bz apply":able, just something to read
> your thoughts from.

I don't have any code for this, but I'll post something to bug 11390 in a minute.