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)
This commit is contained in:
Brian S. Stephan 2011-07-26 18:32:06 -05:00
parent 9ecd66f94a
commit 70e1ee017f
1 changed files with 1 additions and 1 deletions

View File

@ -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
)
"""