Created by Nick Moffitt on 2013-02-19 and last modified on 2013-04-26
Get this branch:
bzr branch lp:~nick-moffitt/charms/precise/keystone/migrate-sqlite-to-mysql
Only Nick Moffitt can upload to this branch. If you are Nick Moffitt please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Nick Moffitt

Recent revisions

42. By Nick Moffitt on 2013-04-26

Moved sqlfairy installation insurance down to the db_changed hook, so that it happens only when it's needed.
This is in response to https://code.launchpad.net/~nick-moffitt/charms/precise/keystone/migrate-sqlite-to-mysql/+merge/149334/comments/327313

41. By Nick Moffitt on 2013-02-26

Fix the half-finished upgrade-charm work.

40. By Nick Moffitt on 2013-02-19

Automatically migrate the database schema and contents when moving from sqlite to mysql.

This change uses sqlfairy (http://packages.ubuntu.com/precise/libsql-translator-perl) to migrate the schema and then all rows from the default sqlite database over to the new database when the mysql relation fires for the first time. The rationale is that users may not realize that they're using sqlite until it's too late, and adding the relation caused a loss of all authentication data.

The SQL generated from sqlfairy needed some manipulation in order to work.
In particular:

    * "UNIQUE `` (`name`)" commands needed a UID of some sort between the ``
      for mysql to accept them
    * As we're running these mysql 'LOAD DATA' commands from a remote
      client, 'LOAD DATA INFILE' needed to become 'LOAD DATA LOCAL INFILE',
      and the mysql client needed to be explicitly told to allow this

The install hook edits configuration entries, risking loss of idempotence. Instead of just re-running it in the upgrade hook, I've replicated the apt-get commands.

39. By Adam Gandelman on 2012-12-19

Merge post-Diablo swift support.

38. By Adam Gandelman on 2012-12-05

Trivial fix: Use correct versioning for Grizzly (2013.1).

37. By Adam Gandelman on 2012-12-03

Merge support for Quantum service from p:~james-page/charms/precise/keystone/quantum-support.

36. By Adam Gandelman on 2012-11-29

Merge fixes for handling of deb source URLs.

35. By Adam Gandelman on 2012-10-25

Add upgrade support, common code.

34. By Adam Gandelman on 2012-09-17

Add missing sym link: hooks/config-changed.

33. By Adam Gandelman on 2012-08-10

Merged config-changed support from lp:~gandelman-a/charms/precise/keystone/config-changed

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
This branch contains Public information 
Everyone can see this information.