1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mattermost_ynh.git synced 2024-09-03 19:36:29 +02:00

Reapply helpers-2.1 autoscript after fixes etc

This commit is contained in:
Alexandre Aubin 2024-06-23 16:48:37 +02:00
parent 6e0ea8868d
commit 574453228f
4 changed files with 10 additions and 8 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
.vagrant .vagrant
*~ *~
~.sw[op] *.sw[op]
.DS_Store .DS_Store

View file

@ -17,7 +17,7 @@ userdoc = "https://docs.mattermost.com/guides/messaging.html"
code = "https://github.com/mattermost/mattermost-server" code = "https://github.com/mattermost/mattermost-server"
[integration] [integration]
yunohost = ">= 11.2" yunohost = ">= 11.2.16"
helpers_version = "2.1" helpers_version = "2.1"
architectures = ["amd64", "armhf", "arm64"] architectures = ["amd64", "armhf", "arm64"]
multi_instance = true multi_instance = true

View file

@ -38,9 +38,9 @@ mariadb-to-pg() {
popd popd
# Some fixes to let the MariaDB -> PostgreSQL conversion working # Some fixes to let the MariaDB -> PostgreSQL conversion working
ynh_psql_db_shell <<< "'DROP INDEX public.idx_fileinfo_content_txt;' ynh_psql_db_shell <<< 'DROP INDEX public.idx_fileinfo_content_txt;'
ynh_psql_db_shell <<< "'DROP INDEX public.idx_posts_message_txt;' ynh_psql_db_shell <<< 'DROP INDEX public.idx_posts_message_txt;'
ynh_mysql_db_shell <<< "ALTER TABLE mattermost.Users DROP COLUMN IF EXISTS acceptedtermsofserviceid;" ynh_mysql_db_shell <<< "ALTER TABLE mattermost.Users DROP COLUMN IF EXISTS acceptedtermsofserviceid;"
@ -81,15 +81,15 @@ EOT
pgloader $tmpdir/commands.load pgloader $tmpdir/commands.load
# Rebuild INDEX # Rebuild INDEX
ynh_psql_db_shell <<< "'CREATE INDEX idx_fileinfo_content_txt ON public.fileinfo USING gin (to_tsvector('\''english'\''::regconfig, content))' ynh_psql_db_shell <<< 'CREATE INDEX idx_fileinfo_content_txt ON public.fileinfo USING gin (to_tsvector('\''english'\''::regconfig, content))'
ynh_psql_db_shell <<< "'CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('\''english'\''::regconfig, (message)::text));' ynh_psql_db_shell <<< 'CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('\''english'\''::regconfig, (message)::text));'
if ynh_compare_current_package_version --comparison eq --version 7.3.0~ynh1 if ynh_compare_current_package_version --comparison eq --version 7.3.0~ynh1
then then
# There is a problem with version 7.3.0 and the database migration. # There is a problem with version 7.3.0 and the database migration.
# More information here: https://forum.mattermost.com/t/migrating-from-mariadb-to-postgresql-db/14194/6 # More information here: https://forum.mattermost.com/t/migrating-from-mariadb-to-postgresql-db/14194/6
ynh_psql_db_shell <<< ""DELETE FROM db_migrations WHERE version=92;" ynh_psql_db_shell <<< "DELETE FROM db_migrations WHERE version=92;"
fi fi

View file

@ -8,12 +8,14 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
# Save the language used if not present # Save the language used if not present
# FIXME: maybe replace with: ynh_app_setting_set_default --key=language --value="en"
if [ -z "${language:-}" ]; then if [ -z "${language:-}" ]; then
language="en" language="en"
ynh_app_setting_set --key=language --value=$language ynh_app_setting_set --key=language --value=$language
fi fi
# If version setting doesn't exist # If version setting doesn't exist
# FIXME: maybe replace with: ynh_app_setting_set_default --key=version --value="Team"
if [ -z "${version:-}" ]; then if [ -z "${version:-}" ]; then
version="Team" version="Team"
ynh_app_setting_set --key=version --value=$version ynh_app_setting_set --key=version --value=$version
@ -107,7 +109,7 @@ UPDATE SidebarCategories set sorting = 'manual' where sorting='';
UPDATE SidebarCategories set sorting = 'manual' where sorting IS NULL; UPDATE SidebarCategories set sorting = 'manual' where sorting IS NULL;
EOM EOM
ynh_psql_db_shell <<< ""$fix_old_version_sql" ynh_psql_db_shell <<< "$fix_old_version_sql"
# Note: it's possible that some instances need other fixes # Note: it's possible that some instances need other fixes
# If nothing is displayed in the sidebar it may be needed to change the Id of SidebarCategories... # If nothing is displayed in the sidebar it may be needed to change the Id of SidebarCategories...