
from trac.db import Table, Column

name = 'mastertickets'
version = 2
tables = [
    Table('mastertickets', key=('source','dest'))[
        Column('source', type='integer'),
        Column('dest', type='integer'),
    ],
]

def convert_to_int(data):
    """Convert both source and dest in the mastertickets table to ints."""
    for row in data['mastertickets'][1]:
        for i, (n1, n2) in enumerate(row):
            row[i] = [int(n1), int(n2)]

migrations = [
    (xrange(1,2), convert_to_int),
]

from trac.db import Table, Column

name = 'mastertickets'
version = 2
tables = [
    Table('mastertickets', key=('source','dest'))[
        Column('source', type='integer'),
        Column('dest', type='integer'),
    ],
]

def convert_to_int(data):
    """Convert both source and dest in the mastertickets table to ints."""
    rows = data['mastertickets'][1]
    for i, (n1, n2) in enumerate(rows):
        rows[i] = [int(n1), int(n2)]

migrations = [
    (xrange(1,2), convert_to_int),
]
Fix the migration to actual work.
Fix the migration to actual work.

  
  from trac.db import Table, Column
  
  name = 'mastertickets'
  version = 2
  tables = [
      Table('mastertickets', key=('source','dest'))[
          Column('source', type='integer'),
          Column('dest', type='integer'),
      ],
  ]
  
  def convert_to_int(data):
      """Convert both source and dest in the mastertickets table to ints."""
-     for row in data['mastertickets'][1]:
+     rows = data['mastertickets'][1]
-         for i, (n1, n2) in enumerate(row):
+     for i, (n1, n2) in enumerate(rows):
-             row[i] = [int(n1), int(n2)]
+         rows[i] = [int(n1), int(n2)]
  
  migrations = [
      (xrange(1,2), convert_to_int),
  ]
Fix the migration to actual work.
## Code Before:

from trac.db import Table, Column

name = 'mastertickets'
version = 2
tables = [
    Table('mastertickets', key=('source','dest'))[
        Column('source', type='integer'),
        Column('dest', type='integer'),
    ],
]

def convert_to_int(data):
    """Convert both source and dest in the mastertickets table to ints."""
    for row in data['mastertickets'][1]:
        for i, (n1, n2) in enumerate(row):
            row[i] = [int(n1), int(n2)]

migrations = [
    (xrange(1,2), convert_to_int),
]
## Instruction:
Fix the migration to actual work.
## Code After:

from trac.db import Table, Column

name = 'mastertickets'
version = 2
tables = [
    Table('mastertickets', key=('source','dest'))[
        Column('source', type='integer'),
        Column('dest', type='integer'),
    ],
]

def convert_to_int(data):
    """Convert both source and dest in the mastertickets table to ints."""
    rows = data['mastertickets'][1]
    for i, (n1, n2) in enumerate(rows):
        rows[i] = [int(n1), int(n2)]

migrations = [
    (xrange(1,2), convert_to_int),
]