Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions developer_manual/app_development/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,17 @@ so for example **notestutorial/lib/Migration/Version000000Date20181013124731.php
}
}

To create the tables in the database, the :doc:`version tag <info>` in **notestutorial/appinfo/info.xml** needs to be increased:
To create the tables in the database, run the :ref:`migration <migration_console_command>` command::

php ./occ migrations:excute <appId> <versionNumber>

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 <info>` in **notestutorial/appinfo/info.xml** . migration will be executed when user reload page after app upgrade

.. code-block:: xml

<?xml version="1.0"?>
<?xml version="1.0"?>
<info>
<id>notestutorial</id>
<name>Notes Tutorial</name>
Expand All @@ -283,7 +289,6 @@ To create the tables in the database, the :doc:`version tag <info>` in **notestu
</dependencies>
</info>

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 <storage/database>` in **notestutorial/lib/Db/Note.php**:

Expand Down
2 changes: 1 addition & 1 deletion developer_manual/basics/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to your actual PR's topic but 👍 on this one


For example, if a user is created, a `UserCreatedEvent` will be emitted.

Expand Down
2 changes: 2 additions & 0 deletions developer_manual/basics/storage/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------

Expand Down