Changeset 49


Ignore:
Timestamp:
05/14/09 18:51:23 (3 years ago)
Author:
tom
Message:

Update the interactive migration tool for the RC6 schema.

This patch updates the interactive migration tool to recognise
and upgrade to the RC6 database schema.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • migration/migrate.py

    r34 r49  
    3434V_RC4           = 1 
    3535V_RC5           = 2 
    36 LATEST_VERSION  = V_RC5 
     36V_RC6           = 3 
     37LATEST_VERSION  = V_RC6 
    3738UNKNOWN_VERSION = -1 
    3839 
    3940version_names       = { V_RC4: "RC4", 
    4041                        V_RC5: "RC5", 
     42                        V_RC6: "RC6", 
    4143                        UNKNOWN_VERSION: "(unknown)" } 
    4244 
    4345upgrade_sql_files   = { V_RC4: "rc4-to-rc5.sql", 
    44                         V_RC5: None } 
     46                        V_RC5: "rc5-to-rc6.sql", 
     47                        V_RC6: None } 
    4548 
    4649def detect_xts_version(db): 
    4750    has_payment_type = False 
     51    has_online = False 
    4852     
    4953    tables = db.query("SHOW TABLES;"); 
     
    5559    if not has_payment_type: 
    5660        return V_RC4 
    57     return V_RC5 
     61         
     62    proto_table = db.query("SHOW COLUMNS FROM snewts_ticketprototype"); 
     63    for proto_col in proto_table: 
     64        if proto_col.values()[0] == "online": 
     65                has_online = True 
     66                break 
     67     
     68    if not has_online: 
     69        return V_RC5 
     70     
     71    return V_RC6 
    5872 
    5973def run_migrate_step(ver, db, mcb): 
Note: See TracChangeset for help on using the changeset viewer.