Changeset 489:ee753e2661c1

Show
Ignore:
Timestamp:
01/23/10 15:53:22 (7 months ago)
Author:
rgrp <http://rufuspollock.org>
Branch:
default
Message:

[migration][s]: fixes to existing revision_id and state migrations (they were really broken!!).

Location:
microfacts/migration/versions
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • microfacts/migration/versions/002_update_vdm_ids.py

    r482 r489  
    2424    dropped_fk_constraints = [] 
    2525    revision_table = Table('revision', metadata, autoload=True) 
    26     foreign_tables = ['factlet', 'thread', 'thread_factlet_table'] 
     26    foreign_tables = ['factlet', 'factlet_revision', 
     27            'thread', 'thread_revision', 
     28            'thread_factlet_table', 'thread_factlet_table_revision'] 
    2729    for table_name in foreign_tables: 
    2830        table = Table(table_name, metadata, autoload=True) 
  • microfacts/migration/versions/003_remove_state_object.py

    r484 r489  
    99def upgrade(): 
    1010    stateful_tables = [ 
    11             'license', 
    1211            'thread', 'thread_revision', 
    1312            'factlet', 'factlet_revision', 
    14             'thread_factlet', 'thread_factlet_revision', 
     13            'thread_factlet_table', 'thread_factlet_table_revision', 
    1514            'revision' 
    1615            ] 
     
    2120        column.create(table) 
    2221        for (name,id) in [ ('active',1), ('deleted',2), ('pending',3) ]: 
    23             sqlcmd = '''UPDATE %s SET state = %s WHERE state_id = %s''' % (table.name, name, id) 
     22            sqlcmd = '''UPDATE %s SET state = '%s' WHERE state_id = %s''' % (table.name, name, id) 
    2423            migrate_engine.execute(sqlcmd) 
    2524        stateid = table.c['state_id']