mirror of
https://github.com/nextcloud/server.git
synced 2026-06-18 05:00:03 -04:00
* Prefer pg_depend to discover the authoritative owning table/column for a sequence (falls back to information_schema only when needed). * Feature-detect and use pg_catalog.pg_sequences to read last_value server-side (fall back to quoted-identifier when unavailable). * Perform a single atomic server-side setval using GREATEST(COALESCE(MAX(...), 0), last_value) and bind the sequence via ?::regclass to avoid search_path / quoting mismatches and to never move a sequence backwards. * Add explicit has_sequence_privilege(..., 'UPDATE') checks and fail-fast error handling for missing privilege, no owner, or multiple owners. * Refactor into small helpers (canUsePgSequences, findSequenceOwner, hasUpdatePrivilege, buildSetvalSqlAndParams) for clarity and testability. BREAKING CHANGE: resynchronizeDatabaseSequences now fails fast for sequences with no owner or multiple owners and requires UPDATE privilege (or ownership) to set sequences; callers that relied on the previous silent/unspecified behavior should handle these exceptions. Signed-off-by: Josh <josh.t.richards@gmail.com> |
||
|---|---|---|
| .. | ||
| composer | ||
| l10n | ||
| private | ||
| public | ||
| unstable | ||
| base.php | ||
| versioncheck.php | ||