Fossil SCM

Make sure the PLINK.BASEID column exists when opening the repository database.

drh 2015-01-26 18:34 trunk
Commit b00e9ac8bb38c0b85fe91cef4b25e71656e8852a
1 file changed +12 -1
+12 -1
--- src/db.c
+++ src/db.c
@@ -1176,15 +1176,26 @@
11761176
db_open_or_attach(g.zRepositoryName, "repository", 0);
11771177
g.repositoryOpen = 1;
11781178
/* Cache "allow-symlinks" option, because we'll need it on every stat call */
11791179
g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
11801180
g.zAuxSchema = db_get("aux-schema","");
1181
+
1182
+ /* Verify that the PLINK table has a new column added by the
1183
+ ** 2014-11-28 schema change. Create it if necessary. This code
1184
+ ** can be removed in the future, once all users have upgraded to the
1185
+ ** 2014-11-28 or later schema.
1186
+ */
1187
+ if( !db_table_has_column("repository","plink","baseid") ){
1188
+ db_multi_exec(
1189
+ "ALTER TABLE %s.plink ADD COLUMN baseid;", db_name("repository")
1190
+ );
1191
+ }
11811192
11821193
/* Verify that the MLINK table has the newer columns added by the
11831194
** 2015-01-24 schema change. Create them if necessary. This code
11841195
** can be removed in the future, once all users have upgraded to the
1185
- ** 2015-01-24 schema.
1196
+ ** 2015-01-24 or later schema.
11861197
*/
11871198
if( !db_table_has_column("repository","mlink","isaux") ){
11881199
db_begin_transaction();
11891200
db_multi_exec(
11901201
"ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;"
11911202
--- src/db.c
+++ src/db.c
@@ -1176,15 +1176,26 @@
1176 db_open_or_attach(g.zRepositoryName, "repository", 0);
1177 g.repositoryOpen = 1;
1178 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
1179 g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
1180 g.zAuxSchema = db_get("aux-schema","");
 
 
 
 
 
 
 
 
 
 
 
1181
1182 /* Verify that the MLINK table has the newer columns added by the
1183 ** 2015-01-24 schema change. Create them if necessary. This code
1184 ** can be removed in the future, once all users have upgraded to the
1185 ** 2015-01-24 schema.
1186 */
1187 if( !db_table_has_column("repository","mlink","isaux") ){
1188 db_begin_transaction();
1189 db_multi_exec(
1190 "ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;"
1191
--- src/db.c
+++ src/db.c
@@ -1176,15 +1176,26 @@
1176 db_open_or_attach(g.zRepositoryName, "repository", 0);
1177 g.repositoryOpen = 1;
1178 /* Cache "allow-symlinks" option, because we'll need it on every stat call */
1179 g.allowSymlinks = db_get_boolean("allow-symlinks", 0);
1180 g.zAuxSchema = db_get("aux-schema","");
1181
1182 /* Verify that the PLINK table has a new column added by the
1183 ** 2014-11-28 schema change. Create it if necessary. This code
1184 ** can be removed in the future, once all users have upgraded to the
1185 ** 2014-11-28 or later schema.
1186 */
1187 if( !db_table_has_column("repository","plink","baseid") ){
1188 db_multi_exec(
1189 "ALTER TABLE %s.plink ADD COLUMN baseid;", db_name("repository")
1190 );
1191 }
1192
1193 /* Verify that the MLINK table has the newer columns added by the
1194 ** 2015-01-24 schema change. Create them if necessary. This code
1195 ** can be removed in the future, once all users have upgraded to the
1196 ** 2015-01-24 or later schema.
1197 */
1198 if( !db_table_has_column("repository","mlink","isaux") ){
1199 db_begin_transaction();
1200 db_multi_exec(
1201 "ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;"
1202

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button