Fossil SCM
For "fossil chat backup", when transfering content from the transfer table into the repository, be explicit about column names, as the column names might be in a different order.
Commit
e983a7dc93296217125440af60edfe2c8f54fc43d328e490b75bcba5e8eeaba4
Parent
1827a314878fecb…
1 file changed
+4
-1
+4
-1
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -1085,11 +1085,14 @@ | ||
| 1085 | 1085 | fossil_fatal("cannot open patch database: %s", sqlite3_errmsg(g.db)); |
| 1086 | 1086 | } |
| 1087 | 1087 | nChat = db_int(0, "SELECT count(*) FROM chatbu.chat"); |
| 1088 | 1088 | fossil_print("Got %d new records, %d bytes\n", nChat, blob_size(&down)); |
| 1089 | 1089 | db_multi_exec( |
| 1090 | - "REPLACE INTO repository.chat SELECT * FROM chatbu.chat;" | |
| 1090 | + "REPLACE INTO repository.chat(msgid,mtime,lmtime,xfrom,xmsg," | |
| 1091 | + "fname,fmime,mdel,file)" | |
| 1092 | + " SELECT msgid,mtime,lmtime,xfrom,xmsg,fname,fmime,mdel,file" | |
| 1093 | + " FROM chatbu.chat;" | |
| 1091 | 1094 | ); |
| 1092 | 1095 | } |
| 1093 | 1096 | }else if( strcmp(g.argv[2],"url")==0 ){ |
| 1094 | 1097 | /* Show the URL to access chat. */ |
| 1095 | 1098 | fossil_print("%s/chat\n", zUrl); |
| 1096 | 1099 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -1085,11 +1085,14 @@ | |
| 1085 | fossil_fatal("cannot open patch database: %s", sqlite3_errmsg(g.db)); |
| 1086 | } |
| 1087 | nChat = db_int(0, "SELECT count(*) FROM chatbu.chat"); |
| 1088 | fossil_print("Got %d new records, %d bytes\n", nChat, blob_size(&down)); |
| 1089 | db_multi_exec( |
| 1090 | "REPLACE INTO repository.chat SELECT * FROM chatbu.chat;" |
| 1091 | ); |
| 1092 | } |
| 1093 | }else if( strcmp(g.argv[2],"url")==0 ){ |
| 1094 | /* Show the URL to access chat. */ |
| 1095 | fossil_print("%s/chat\n", zUrl); |
| 1096 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -1085,11 +1085,14 @@ | |
| 1085 | fossil_fatal("cannot open patch database: %s", sqlite3_errmsg(g.db)); |
| 1086 | } |
| 1087 | nChat = db_int(0, "SELECT count(*) FROM chatbu.chat"); |
| 1088 | fossil_print("Got %d new records, %d bytes\n", nChat, blob_size(&down)); |
| 1089 | db_multi_exec( |
| 1090 | "REPLACE INTO repository.chat(msgid,mtime,lmtime,xfrom,xmsg," |
| 1091 | "fname,fmime,mdel,file)" |
| 1092 | " SELECT msgid,mtime,lmtime,xfrom,xmsg,fname,fmime,mdel,file" |
| 1093 | " FROM chatbu.chat;" |
| 1094 | ); |
| 1095 | } |
| 1096 | }else if( strcmp(g.argv[2],"url")==0 ){ |
| 1097 | /* Show the URL to access chat. */ |
| 1098 | fossil_print("%s/chat\n", zUrl); |
| 1099 |