Merge pull request #1056 from nextcloud/backport/1054/stable15

[stable15] Everybody should use migrations
This commit is contained in:
John Molakvoæ 2018-12-19 14:49:58 +01:00 committed by GitHub
commit a2b6cb4955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 3 deletions

View File

@ -2,6 +2,9 @@
Migrations
==========
.. app_db_migrations:
In the past, apps had a `appinfo/database.xml`-file which holds their database schema
for installation and update and was a functional method for installing apps which
had some trouble with upgrading apps (e.g. apps were not able to rename columns
@ -116,6 +119,22 @@ With this the old column gets removed.
return $schema;
}
Migrate from database.xml
-------------------------
To migrate your app from a `database.xml` file to migrations run:
.. code-block:: bash
php ./occ migrations:generate-from-schema <app_id> <version>
This will create a new file under `lib/Migration` that results in the
same database table(s) as your database.xml file.
For version you should use the your app versions. So if you app is at version
1.2.3 use 010203.
Don't forget to remove your `database.xml` file.
Console commands
----------------

View File

@ -1,6 +1,9 @@
===============
Database schema
===============
============================
Database schema (deprecated)
============================
.. note:: Using the database.xml schema file is deprecated. You should migrate
to using :ref:`Databse Migrations app_db_migrations`.
.. sectionauthor:: Bernhard Posselt <dev@bernhard-posselt.com>