Permalink
Browse files

migration script for converting to sheet_collections

  • Loading branch information...
cooperq committed Jul 25, 2013
1 parent 01e6a67 commit f05d456aedcd0a320aa99527aa39e95344c307c7
Showing with 13 additions and 0 deletions.
  1. +13 −0 migrate.py
View
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+import MySQLdb
+
+db = MySQLdb.connect(host='localhost',
+ user='root',
+ passwd='ethersheet',
+ db='ethersheet')
+cur = db.cursor()
+cur.execute('SELECT `key` FROM store where `key` LIKE "%:cells"');
+for row in cur.fetchall():
+ sheet_name = row[0][:-6]
+ sql = "INSERT INTO store (`key`,`value`) VALUES ('" + sheet_name + ":sheet_collection', '[\"" + sheet_name + "\"]');"
+ print sql

0 comments on commit f05d456

Please sign in to comment.