Changes between Version 12 and Version 13 of BluePrintDatabaseMigration

04/06/11 16:44:55 (10 years ago)
Pat Tressel



  • BluePrintDatabaseMigration

    v12 v13  
    22= !BluePrint for automated database migration across schema changes =
     4This project, or rather, subsets of it, are suggested as GSoC projects. At the bottom of the page are some options for splitting the work up into parts that should be doable in one summer.
    56This project involves raw database operations on live user data, where the results must be carefully validated to avoid unrecoverable data loss. It will require knowledge of SQL and database administration, code generation or an equivalent means of specifying the process of converting a database, providing a UI when human assistance is needed to specify the conversion. It will also involve a knowledge of Web2py and DAL.
    5859=== Existing Tools ===
    59 We use dbstruct to handle this:
     60We use dbstruct to handle some types of migration:
    6061 * MySQL:
    6162 * PostgreSQL:
    6263This is normally called from fabfile:
    6364 *
     65However, dbstruct does not handle table or field renames -- it has no way to know what name "before"
     66should become what name "after". It would assume a renamed table was deleted, and drop it.
     67Nor does it know what to do with added non-null, undefaulted columns, nor table refactoring in general.
     68It could be a starting point for a script to do conversion of a database, given the needed info about
     69name changes and other transformations.
     71There is also a topological sort tool that reads either a MySQL database schema or the Web2py *.table
     72files and produces a list of tables in topological order by foreign key dependencies (and reports if
     73there are circular dependencies). This allows dumping the database in an order such that there will
     74be no constraint issues when it's loaded.
     76=== Some suggested subsets for GSoC ===