Changes between Version 12 and Version 13 of BluePrintDatabaseMigration
- Timestamp:
- 04/06/11 16:44:55 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrintDatabaseMigration
v12 v13 2 2 = !BluePrint for automated database migration across schema changes = 3 3 4 This 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. 4 5 5 6 This 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. … … 57 58 58 59 === Existing Tools === 59 We use dbstruct to handle this:60 We use dbstruct to handle some types of migration: 60 61 * MySQL: http://eden.sahanafoundation.org/browser/static/scripts/tools/dbstruct_mysql.py 61 62 * PostgreSQL: http://eden.sahanafoundation.org/browser/static/scripts/tools/dbstruct_postgresql.py 62 63 This is normally called from fabfile: 63 64 * http://eden.sahanafoundation.org/browser/static/scripts/tools/fabfile.py 65 However, dbstruct does not handle table or field renames -- it has no way to know what name "before" 66 should become what name "after". It would assume a renamed table was deleted, and drop it. 67 Nor does it know what to do with added non-null, undefaulted columns, nor table refactoring in general. 68 It could be a starting point for a script to do conversion of a database, given the needed info about 69 name changes and other transformations. 70 71 There is also a topological sort tool that reads either a MySQL database schema or the Web2py *.table 72 files and produces a list of tables in topological order by foreign key dependencies (and reports if 73 there are circular dependencies). This allows dumping the database in an order such that there will 74 be no constraint issues when it's loaded. 75 76 === Some suggested subsets for GSoC === 64 77 65 78 ----