diff --git a/developer_manual/app/storage/migrations.rst b/developer_manual/app/storage/migrations.rst index 74910aeea..e5f2115f7 100644 --- a/developer_manual/app/storage/migrations.rst +++ b/developer_manual/app/storage/migrations.rst @@ -135,6 +135,8 @@ For version you should use the your app versions. So if you app is at version Don't forget to remove your `database.xml` file. +.. _migration_console_command: + Console commands ---------------- diff --git a/developer_manual/app/tutorial.rst b/developer_manual/app/tutorial.rst index 8b045dc0e..0350d9617 100644 --- a/developer_manual/app/tutorial.rst +++ b/developer_manual/app/tutorial.rst @@ -264,11 +264,17 @@ so for example **notestutorial/lib/Migration/Version000000Date20181013124731.php } } -To create the tables in the database, the :doc:`version tag ` in **notestutorial/appinfo/info.xml** needs to be increased: +To create the tables in the database, run the :ref:`migration ` command:: + + php ./occ migrations:excute + + Example: sudo -u www-data php ./occ migrations:execute photos 000000Date20201002183800 + +.. note:: to trigger the tabele creation/alteration when user updating the app, update the :doc:`version tag ` in **notestutorial/appinfo/info.xml** . migration will be executed when user reload page after app upgrade .. code-block:: xml - + notestutorial Notes Tutorial @@ -283,7 +289,6 @@ To create the tables in the database, the :doc:`version tag ` in **notestu -Reload the page to trigger the database migration. Now that the tables are created we want to map the database result to a PHP object to be able to control data. First create an :doc:`entity ` in **notestutorial/lib/Db/Note.php**: