Software /
code /
prosody
Comparison
tools/migration/migrator/prosody_sql.lua @ 4310:52ccbf71d062
migrator/prosody_sql.lua: Fix for compatibility with non-MySQL databases
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 05 Jun 2011 11:53:41 +0100 |
parent | 4294:d2406f0ce8a5 |
child | 5776:bd0ff8ae98a8 |
comparison
equal
deleted
inserted
replaced
4309:7ad81d81f5ec | 4310:52ccbf71d062 |
---|---|
40 local ok, commit_ok, commit_err; | 40 local ok, commit_ok, commit_err; |
41 if stmt then | 41 if stmt then |
42 ok, err = assert(stmt:execute()); | 42 ok, err = assert(stmt:execute()); |
43 commit_ok, commit_err = assert(connection:commit()); | 43 commit_ok, commit_err = assert(connection:commit()); |
44 end | 44 end |
45 else -- COMPAT: Upgrade tables from 0.8.0 | 45 elseif params.driver == "MySQL" then -- COMPAT: Upgrade tables from 0.8.0 |
46 -- Failed to create, but check existing MySQL table here | 46 -- Failed to create, but check existing MySQL table here |
47 local stmt = connection:prepare("SHOW COLUMNS FROM prosody WHERE Field='value' and Type='text'"); | 47 local stmt = connection:prepare("SHOW COLUMNS FROM prosody WHERE Field='value' and Type='text'"); |
48 local ok = stmt:execute(); | 48 local ok = stmt:execute(); |
49 local commit_ok = connection:commit(); | 49 local commit_ok = connection:commit(); |
50 if ok and commit_ok then | 50 if ok and commit_ok then |