96 Commits

Author SHA1 Message Date
Carl Schwan
7b6078875b refactor: Run rector on lib/private
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:50:18 +01:00
Ferdinand Thiessen
67eef32b07 fix(DB): support up to 63 character long table and index names
We do not support Oracle 11 anymore but at least Oracle 12c (12.2).
So the limitation is gone (Oracle now supports up to 128 character long
names).

Instead we are now limited by MySQL (64 characters) and PostgreSQL (63
characters).

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-18 14:50:34 +01:00
Carl Schwan
9095a36b94 refactor(dbal): Port away from getDatabasePlatform() instanceof pattern
Use getDatabaseProvider instead.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-13 13:44:08 +02:00
Carl Schwan
7a43bf26ca refactor(dbal): Migrate away from Type::getName
Instead use Type::lookupName

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-10 16:13:09 +02:00
Carl Schwan
b0c6ef5821 refactor(dbal): Port away from deprecated hasPrimaryKey
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-10 15:44:43 +02:00
Carl Schwan
837fe3586d feat(db): Restaure support for non-nullable boolean column
We disabled them because they are not supported on Oracle DB and it is
still the case for OCI < 23. But instead of disabling the support
completely for every database types, mark non-nullable boolean column as
actually nullable when using Oracle.

This allow to use some slighly lighter schema on normal databases who
support natively booleans wheen we don't need to store 3 states
true|false|null.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-09-17 14:45:48 +02:00
Côme Chilliet
b7c15949ce chore: Get rid of AppLocator helper
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2025-08-18 17:09:40 +02:00
Ferdinand Thiessen
5981b7eb51 chore: apply new CSFixer rules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>

# Conflicts:
#	apps/settings/lib/SetupChecks/PhpOpcacheSetup.php
2025-07-01 16:26:50 +02:00
Robin Appelman
fc2cda12b5 fix: use proper migration sorting when checking if a migration needs to be executed
Signed-off-by: Robin Appelman <robin@icewind.nl>
2025-04-02 14:29:08 +02:00
provokateurin
9836e9b164 chore(deps): Update nextcloud/coding-standard to v1.3.1
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-09-19 14:21:20 +02:00
Joas Schilling
46c853146b fix(migration): Correctly sort migrations by version number
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-08-27 16:25:10 +02:00
Daniel Kesselberg
af6de04e9e style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Joas Schilling
829f2b9bc7 fix(db): Promote the use of getDatabaseProvider to reduce the impage of removed upstream platforms
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-07-19 11:21:14 +02:00
Robin Appelman
4f01486da0 feat: add commands for exporting current and expected database schema
Signed-off-by: Robin Appelman <robin@icewind.nl>
2024-07-02 13:45:12 +02:00
Andy Scherzinger
dae7c159f7 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-24 13:11:22 +02:00
Côme Chilliet
ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2024-04-02 14:16:21 +02:00
Simon L
8fd2289058 Merge pull request #43357 from nextcloud/enh/41253/fix-occ-upgrade
fix(migration): Make naming constraint fail softer on updates
2024-02-08 18:27:39 +01:00
Louis Chemineau
898df41de9 Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7, reversing
changes made to ba3fdb0cdc.
2024-02-08 15:31:19 +01:00
Joas Schilling
487c33f479 fix(migration): Make naming constraint fail softer on updates
Only on installation we want to break hard, so that all developers notice
the bugs when installing the app on any database or CI, and can work on
fixing their migrations before releasing a version incompatible with Postgres.

In case of updates we might be running on production instances and the
administrators being faced with the error would not know how to resolve it
anyway. This can also happen with instances, that had the issue before the
current update, so we don't want to make their life more complicated
than needed.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-02-07 20:45:51 +01:00
Joas Schilling
6f39d82031 fix(install): Make installing more verbose
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-03 15:44:46 +01:00
Carl Schwan
e966cfbc4b Cleanup plsam issues in DB/ContactsManager and Console
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2023-09-05 09:20:26 +02:00
Joas Schilling
0bf738d8cb feat(db): Ensure that index names are unique across the database
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-07-20 14:27:26 +02:00
Christoph Wurst
14719110b9 chore: Replace \OC::$server->query with \OCP\Server::get in /lib
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2023-07-06 15:21:22 +02:00
Roeland Jago Douma
d151999fc8 typehint migrationservice closures
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2022-10-09 21:31:27 +02:00
Côme Chilliet
c598e3cafa composer run cs:fix
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-21 16:36:25 +02:00
Côme Chilliet
1bd5222224 Fix PHP 8.2 warnings about undeclared properties
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-06-21 16:17:52 +02:00
Joas Schilling
df36ed4d1a Log missing primary key until we make it a requirement
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-08 10:47:24 +02:00
Joas Schilling
10b2319aa0 Add missing doc changes
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 15:50:33 +02:00
Joas Schilling
82c33be744 Fix typos and empty tabs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 12:42:52 +02:00
John Molakvoæ
0257315c34 Improve error logging on migration failure
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:49:20 +02:00
John Molakvoæ
e20d5fa7fc Ensure schema change before checking OracleConstraints
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
2022-04-07 11:18:14 +02:00
Côme Chilliet
dd357d7f9b Merge pull request #31679 from nextcloud/bugfix/noid/ensure-string-columns-to-be-maximum-of-4000
Ensure string column limit of 4.000 characters
2022-03-31 11:37:43 +02:00
Joas Schilling
129bae62d4 Ensure string column limit of 4.000 characters
https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/datatype-limits.html#GUID-963C79C9-9303-49FE-8F2D-C8AAF04D3095

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-25 12:44:51 +01:00
Côme Chilliet
ea23523c70 Adapt more code to migration to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2022-03-24 16:21:25 +01:00
Joas Schilling
3bed983a9c Disable for now again until more apps are fixed
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-21 12:14:19 +01:00
Joas Schilling
32ede5489e Limit missing primary key fail to new tables
This will work on CI so devs notice it when they install the app for testing,
and at the same time existing faulty tables don't break the upgrade to 24

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-21 12:14:19 +01:00
Joas Schilling
b35253a4c3 Enforce primary keys as they are required to be performant in MySQL clusters
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-03-10 10:24:05 +01:00
John Molakvoæ (skjnldsv)
215aef3cbd Update php licenses
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2021-06-04 22:02:41 +02:00
Christoph Wurst
2ab8268128 Do not check Oracle column constraints in unrelated migrations
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-04-19 13:05:34 +02:00
Joas Schilling
f9d4fa2d38 Rename the method to match what it does
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-31 10:21:18 +02:00
Joas Schilling
3696ef5b96 Don't allow Notnull for boolean columns
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-31 10:21:17 +02:00
Joas Schilling
133a6f4fe4 Document the constraints we test against
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-31 10:21:17 +02:00
Joas Schilling
c98cab137c Fix exception messages spacing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-31 10:21:10 +02:00
Joas Schilling
1e5fea0460 Only mark migrations as installed after execution
The problem is that if a developer creates a structural error in their migration file,
they will already be marked as executed and an not be rerun.

Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-04 08:49:42 +01:00
Joas Schilling
1de3b8b0ec When it kicks in
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-02-18 10:14:12 +01:00
Christoph Wurst
8b64e92b92 Bump doctrine/dbal from 2.12.0 to 3.0.0
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2021-01-08 11:45:19 +01:00
Christoph Wurst
d89a75be0b Update all license headers for Nextcloud 21
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-12-16 18:48:22 +01:00
Julius Härtl
36ffad5ba7 Make sure the migrations table schema is always checked
Signed-off-by: Julius Härtl <jus@bitgrid.net>

Revert "Make sure the migrations table schema is always checked"

This reverts commit 258955ef738a52d9da2ac2fe59466e6093d7e9bc.

Set current vendor during upgrade and perform migrations table change if needed

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-09 15:24:03 +01:00
Joas Schilling
c1f28f8d35 Make debugging migration exceptions easier
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-12-07 19:35:01 +01:00
Joas Schilling
d7b5d4cb58 Revert "Revert "Installation goes brrrr"" 2020-11-11 20:12:13 +01:00