nextcloud/lib
Josh 06173c4acb
feat(db): resynchronize PostgreSQL sequences using pg_depend + pg_sequences
* 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>
2025-11-25 13:52:48 -05:00
..
composer fix(sharing): fix potentially broken shares from the past, change 'null' download permission to 'true' 2025-11-17 10:07:44 +01:00
l10n fix(l10n): Update translations from Transifex 2025-11-20 00:14:17 +00:00
private feat(db): resynchronize PostgreSQL sequences using pg_depend + pg_sequences 2025-11-25 13:52:48 -05:00
public refactor(ServerVersion): Add missing type hinting 2025-11-20 16:48:26 +01:00
unstable fix(lexicon): missing doc 2025-07-24 15:56:35 -01:00
base.php fix: Delete legacy OC_Response 2025-09-29 09:35:32 +02:00
versioncheck.php fix(PHP): Drop PHP 8.1 for Nextcloud 33 2025-10-02 11:04:07 +02:00