zotero/resource/schema
Dan Stillman 0f96c20f3c Fix several possible DB upgrade errors from 4.0 to 5.0
- We were updating global schema before migrating userdata, but a 4 → 5
  upgrade involved a system.sql version bump, which wiped out itemTypes,
  causing 'annotation' to not exist after the upgrade. This moves global
  schema updates after userdata migration and bumps the global schema
  version to repair DBs that were already upgraded and broken.

- A system.sql bump without a global schema update would result in empty
  tables. This moves the global-schema-related tables to userdata.sql.

- The DB integrity check before userdata updates added in 5b9e6497a
  could fail when coming from an older DB, because the checks assume
  current schema. An integrity check is now done after a userdata update.
  (We were already skipping the new table/index reconciliation stuff. If
  old DBs are discovered to have problems that would cause a migration
  step to fail, we'll fix those explicitly in the steps.)

Also:

- Make sure `version` is `versionNumber` in the `fields` table. It was
  changed with a system.sql bump in 5.0, but hard-coded fields were later
  removed from system.sql in favor of schema.json, meaning that anyone who
  upgraded from 4.0 after that would never have `version` removed and so
  would have both fields (one from before and one from schema.json).
2021-08-17 00:41:59 -04:00
..
global@97e0a8efa2 Fix several possible DB upgrade errors from 4.0 to 5.0 2021-08-17 00:41:59 -04:00
abbreviations.json Fix invalid tab characters in abbreviations.json 2019-11-23 00:49:21 -07:00
connectorTypeSchemaData.js Fix base fields in connectorTypeSchemaData.js 2018-05-10 02:26:44 -04:00
dateFormats.json What's all this, then? A British English locale? I say! 2019-04-16 03:33:30 -04:00
engines.json Use HTTPS for Google Scholar and CrossRef lookup engines 2017-07-23 00:57:04 -04:00
renamed-styles.json Update submodules 2020-10-03 17:51:07 -04:00
repotime.txt Update submodules 2021-08-06 16:56:31 -04:00
system-107.sql Fix database after direct upgrade from Zotero 4 to 5.0.78-79 2019-12-03 14:03:22 -07:00
system.sql Fix several possible DB upgrade errors from 4.0 to 5.0 2021-08-17 00:41:59 -04:00
triggers.sql Type/field handling overhaul 2019-09-16 02:27:22 -04:00
userdata.sql Fix several possible DB upgrade errors from 4.0 to 5.0 2021-08-17 00:41:59 -04:00