Remove DB schema docs, add note for NC 22

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
Vincent Petry
2021-06-17 17:42:31 +02:00
parent 004849327a
commit ebca005493
3 changed files with 13 additions and 59 deletions

View File

@@ -6,6 +6,14 @@ Once you've created and published the first version of your app, you will want t
This document will cover the most important changes in Nextcloud, as well as some guides on how to upgrade existing apps.
Upgrading to Nextcloud 22
-------------------------
Removed support for database.xml
********************************
The support for an app's ``appinfo/database.xml`` has been removed.
Upgrading to Nextcloud 21
-------------------------
@@ -79,6 +87,11 @@ The original `PSR-0` standard was deprecated in 2014 and therefore the support f
.. _`PSR-0`: https://www.php-fig.org/psr/psr-0/
.. _`PSR-4`: https://www.php-fig.org/psr/psr-4/
Last version with database.xml support and migration
****************************************************
Nextcloud 21 is the last major release that supports an app's ``appinfo/database.xml`` to define the database schema. This is your last chance to automatically convert this deprecated file into the new migration classes using ``occ migrations:generate-from-schema``.
Replaced well-known handler API
*******************************

View File

@@ -6,7 +6,6 @@ Storage and database
:maxdepth: 2
migrations
schema
database
configuration
filesystem

View File

@@ -1,58 +0,0 @@
.. _database-xml:
============================
Database schema (deprecated)
============================
.. warning:: Using the database.xml schema file is deprecated.
You should migrate to using :ref:`Database Migrations <app_db_migrations>`.
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>
Nextcloud uses a database abstraction layer on top of either PDO, depending on the availability of PDO on the server.
The database schema is inside :file:`appinfo/database.xml` in MDB2's `XML scheme notation <http://www.wiltonhotel.com/_ext/pear/docs/MDB2/docs/xml_schema_documentation.html>`_ where the placeholders \*dbprefix* (\*PREFIX* in your SQL) and \*dbname* can be used for the configured database table prefix and database name.
An example database XML file would look like this:
.. code-block:: xml
<?xml version="1.0" encoding="UTF-8" ?>
<database>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<name>*dbprefix*yourapp_items</name>
<declaration>
<field>
<name>id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<length>4</length>
</field>
<field>
<name>user</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>name</name>
<type>text</type>
<notnull>true</notnull>
<length>100</length>
</field>
<field>
<name>path</name>
<type>clob</type>
<notnull>true</notnull>
</field>
</declaration>
</table>
</database>
To update the tables used by the app, simply adjust the database.xml file and increase the app version number in :file:`appinfo/info.xml` to trigger an update.