Changes between Version 12 and Version 13 of BluePrintDatabaseMigration


Ignore:
Timestamp:
04/06/11 16:44:55 (14 years ago)
Author:
Pat Tressel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintDatabaseMigration

    v12 v13  
    22= !BluePrint for automated database migration across schema changes =
    33
     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.
    45
    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.
     
    5758
    5859=== Existing Tools ===
    59 We use dbstruct to handle this:
     60We use dbstruct to handle some types of migration:
    6061 * MySQL: http://eden.sahanafoundation.org/browser/static/scripts/tools/dbstruct_mysql.py
    6162 * PostgreSQL: http://eden.sahanafoundation.org/browser/static/scripts/tools/dbstruct_postgresql.py
    6263This is normally called from fabfile:
    6364 * http://eden.sahanafoundation.org/browser/static/scripts/tools/fabfile.py
     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.
     70
     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.
     75
     76=== Some suggested subsets for GSoC ===
    6477
    6578----