Jump to content

Nextcloud: Difference between revisions

Automatically add missing indices
(agpl3Only is preferred now)
(Automatically add missing indices)
Line 248: Line 248:


No password is required.
No password is required.
=== Add missing indices ===
Nextcloud regularly complains about missing indices or missing primary keys and asks you to e.g. run <code>occ db:add-missing-indices</code> manually. In order to automate this, you can create a postStart task for the Nextcloud systemd service to always run that command.
<syntaxhighlight lang="nix">
# Add missing indices after every Nextcloud start. 
systemd.services.phpfpm-nextcloud = {                               
  postStart = ''                                                                     
    php ${pkgs.nextcloud28}/occ db:add-missing-indices         
  '';                           
  path = with pkgs; [ config.services.nextcloud.phpPackage config.services.nextcloud.package ];
};
</syntaxhighlight>
You can add other maintenance commands to the <code>postStart</code> multi-line string.


== Clients ==
== Clients ==
4

edits