Fossil SCM
Make sure the PLINK.BASEID column exists when opening the repository database.
Commit
b00e9ac8bb38c0b85fe91cef4b25e71656e8852a
Parent
2075361ece43d7f…
1 file changed
+12
-1
M
src/db.c
+12
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1176,15 +1176,26 @@ | ||
| 1176 | 1176 | db_open_or_attach(g.zRepositoryName, "repository", 0); |
| 1177 | 1177 | g.repositoryOpen = 1; |
| 1178 | 1178 | /* Cache "allow-symlinks" option, because we'll need it on every stat call */ |
| 1179 | 1179 | g.allowSymlinks = db_get_boolean("allow-symlinks", 0); |
| 1180 | 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 | + } | |
| 1181 | 1192 | |
| 1182 | 1193 | /* Verify that the MLINK table has the newer columns added by the |
| 1183 | 1194 | ** 2015-01-24 schema change. Create them if necessary. This code |
| 1184 | 1195 | ** 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. | |
| 1186 | 1197 | */ |
| 1187 | 1198 | if( !db_table_has_column("repository","mlink","isaux") ){ |
| 1188 | 1199 | db_begin_transaction(); |
| 1189 | 1200 | db_multi_exec( |
| 1190 | 1201 | "ALTER TABLE %s.mlink ADD COLUMN pmid INTEGER DEFAULT 0;" |
| 1191 | 1202 |
| --- 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 |