From 25f549f1d9809ecb04a9b5bae8c91ee4c3a88cda Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 19 Dec 2018 12:20:25 +0100 Subject: [PATCH 1/3] Everybody should use migrations Signed-off-by: Roeland Jago Douma --- developer_manual/app/storage/migrations.rst | 19 +++++++++++++++++++ developer_manual/app/storage/schema.rst | 9 ++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/developer_manual/app/storage/migrations.rst b/developer_manual/app/storage/migrations.rst index 1ce8e432d..5db7567f9 100644 --- a/developer_manual/app/storage/migrations.rst +++ b/developer_manual/app/storage/migrations.rst @@ -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 + +This will create a new file under `lib/Migration` with 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 user 010203. + +Don't forget to remove your `database.xml` file. + Console commands ---------------- diff --git a/developer_manual/app/storage/schema.rst b/developer_manual/app/storage/schema.rst index 6a9e8efbd..15d0fd62a 100644 --- a/developer_manual/app/storage/schema.rst +++ b/developer_manual/app/storage/schema.rst @@ -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 From 486dc87e4f785d241a50f79165b028c3d4dd48a7 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 19 Dec 2018 14:28:40 +0100 Subject: [PATCH 2/3] Update developer_manual/app/storage/migrations.rst Co-Authored-By: rullzer --- developer_manual/app/storage/migrations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_manual/app/storage/migrations.rst b/developer_manual/app/storage/migrations.rst index 5db7567f9..062cc9708 100644 --- a/developer_manual/app/storage/migrations.rst +++ b/developer_manual/app/storage/migrations.rst @@ -127,7 +127,7 @@ To migrate your app from a `database.xml` file to migrations run: .. code-block:: bash php ./occ migrations:generate-from-schema -This will create a new file under `lib/Migration` with that results in the +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 From 97691d3f3b43559a5f02a6606171a4870d02bad5 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 19 Dec 2018 14:28:46 +0100 Subject: [PATCH 3/3] Update developer_manual/app/storage/migrations.rst Co-Authored-By: rullzer --- developer_manual/app/storage/migrations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_manual/app/storage/migrations.rst b/developer_manual/app/storage/migrations.rst index 062cc9708..542843a74 100644 --- a/developer_manual/app/storage/migrations.rst +++ b/developer_manual/app/storage/migrations.rst @@ -131,7 +131,7 @@ 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 user 010203. +1.2.3 use 010203. Don't forget to remove your `database.xml` file.