From 92b14b056bf877c76f1fc233c6c7ef451845fba2 Mon Sep 17 00:00:00 2001 From: navanchauhan Date: Tue, 26 Jul 2022 17:26:24 -0400 Subject: [PATCH] fix upgrade from beta16 --- scripts/from_beta_16.sql | 11 +++++++++++ scripts/upgrade | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 scripts/from_beta_16.sql diff --git a/scripts/from_beta_16.sql b/scripts/from_beta_16.sql new file mode 100644 index 0000000..61af150 --- /dev/null +++ b/scripts/from_beta_16.sql @@ -0,0 +1,11 @@ +SET AUTOCOMMIT = 0; +START TRANSACTION; + +ALTER TABLE `cp_settings` +ADD COLUMN context VARCHAR(255) NULL AFTER `type`; + +ALTER TABLE cp_podcasts ADD COLUMN published_at DATETIME DEFAULT NULL AFTER +updated_by; +UPDATE cp_podcasts SET published_at = created_at; + +COMMIT; diff --git a/scripts/upgrade b/scripts/upgrade index 67df1cf..c416f9a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,6 +116,16 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# MYSQL CONFIGURATION +#================================================= + +if ynh_compare_current_package_version --comparison eq --version 1.0.0-96~ynh1 +then + ynh_script_progression --message="Upgrading MySQL configuration..." --weight=1 + ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./from_beta_16.sql.sql +fi + #================================================= # NGINX CONFIGURATION #=================================================