Skip to content

Commit

Permalink
[#706] make substr index from correct character
Browse files Browse the repository at this point in the history
  • Loading branch information
joetsoi authored and amercader committed Mar 27, 2013
1 parent dd2c016 commit 38b926d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ckan/migration/versions/067_turn_extras_to_strings.py
Expand Up @@ -7,7 +7,7 @@ def upgrade(migrate_engine):
revision_tables = 'package_extra_revision group_extra_revision'

for table in tables.split():
sql = """select id, value from {table} where substr(value,0,1) = '"' """.format(table=table)
sql = """select id, value from {table} where substr(value,1,1) = '"' """.format(table=table)
results = connection.execute(sql)
for result in results:
id, value = result
Expand All @@ -16,7 +16,7 @@ def upgrade(migrate_engine):
json.loads(value), id)

for table in revision_tables.split():
sql = """select id, revision_id, value from {table} where substr(value,0,1) = '"' """.format(table=table)
sql = """select id, revision_id, value from {table} where substr(value,1,1) = '"' """.format(table=table)

results = connection.execute(sql)
for result in results:
Expand Down

0 comments on commit 38b926d

Please sign in to comment.