From 70e1ee017fad3bf7d6f439daf5e6058ad526a1b0 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Tue, 26 Jul 2011 18:32:06 -0500 Subject: [PATCH] make drbotzo_modules.module a primary key so that we can use INSERT OR REPLACE INTO WARNING! if you have an existing drbotzo_modules, you MUST RECREATE IT WITH THE PRIMARY KEY. things will be wonky without it. easiest way is to (by hand) create drbotzo_modules_temp as shown in the code, INSERT INTO drbotzo_modules_temp SELECT * FROM drbotzo_modules, DROP the old table, and ALTER TABLE RENAME TO the new one. again, if you don't do this, newer modules will do all sorts of crazy things, namely trying to create tables that already exist (because they have multiple, differing values in drbotzo_modules) --- dr.botzo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr.botzo.py b/dr.botzo.py index 9ede43e..1c6b016 100644 --- a/dr.botzo.py +++ b/dr.botzo.py @@ -72,7 +72,7 @@ try: # need to create the drbotzo_modules table query = """ CREATE TABLE drbotzo_modules ( - module TEXT, + module TEXT PRIMARY KEY, version INTEGER ) """