From b2233211399902dc80dfd8fc008e2a783fd54338 Mon Sep 17 00:00:00 2001 From: dassio Date: Sun, 4 Oct 2020 10:04:37 +0100 Subject: [PATCH 1/2] add migration to tutorial Signed-off-by: dassio --- developer_manual/app/storage/migrations.rst | 2 ++ developer_manual/app/tutorial.rst | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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**: From b370d32abb275ade40cbb4716981982111b3990c Mon Sep 17 00:00:00 2001 From: dassio Date: Sun, 4 Oct 2020 11:20:37 +0100 Subject: [PATCH 2/2] change to suffixing Signed-off-by: dassio --- developer_manual/app/events.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_manual/app/events.rst b/developer_manual/app/events.rst index 602287056..5632d59fc 100644 --- a/developer_manual/app/events.rst +++ b/developer_manual/app/events.rst @@ -24,7 +24,7 @@ This mechanism is a versatile and typed approach to events in Nextcloud's php co Naming scheme ^^^^^^^^^^^^^ -The name should reflect the subject and the actions. Prefixing event classes with `Event` makes it easier to recognize their purpose. +The name should reflect the subject and the actions. Suffixing event classes with `Event` makes it easier to recognize their purpose. For example, if a user is created, a `UserCreatedEvent` will be emitted.