mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
Drop all Focalbard tables if mattermost is in 7.3.0
This commit is contained in:
parent
b4fcf41f41
commit
8596ecce7b
1 changed files with 9 additions and 0 deletions
|
@ -48,6 +48,15 @@ mariadb-to-pg() {
|
|||
ynh_mysql_execute_as_root --sql="ALTER TABLE mattermost.Users DROP COLUMN IF EXISTS acceptedtermsofserviceid;" --database=$db_name
|
||||
ynh_mysql_execute_as_root --sql="ALTER TABLE mattermost.SharedChannelRemotes DROP COLUMN IF EXISTS description;" --database=$db_name
|
||||
ynh_mysql_execute_as_root --sql="ALTER TABLE mattermost.SharedChannelRemotes DROP COLUMN IF EXISTS nextsyncat;" --database=$db_name
|
||||
|
||||
# Focalboard is broken in Mattermost 7.3.0
|
||||
if ynh_compare_current_package_version --comparison eq --version 7.3.0~ynh1
|
||||
then
|
||||
# Remove Focalboard tables
|
||||
# Command from https://stackoverflow.com/a/1589324
|
||||
cmd=$(ynh_mysql_execute_as_root --sql="SELECT CONCAT( 'DROP TABLE ', GROUP_CONCAT(table_name) , ';' ) AS statement FROM information_schema.tables WHERE table_schema = '$db_name' AND table_name LIKE 'focalboard_%';" --database=$db_name | tail -n 1)
|
||||
ynh_mysql_execute_as_root --sql="$cmd" --database=$db_name
|
||||
fi
|
||||
|
||||
# Use pgloader to migrate database content from MariaDB to PostgreSQL
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
|
Loading…
Add table
Reference in a new issue