diff --git a/conf/sql/v1.5.2.sql b/conf/sql/v1.5.2.sql new file mode 100644 index 0000000..6a2803a --- /dev/null +++ b/conf/sql/v1.5.2.sql @@ -0,0 +1,14 @@ +-- change Twitter to X +INSERT INTO `cp_platforms` (`slug`, `type`, `label`, `home_url`, `submit_url`) VALUES +('x', 'social', 'X', 'https://x.com/', 'https://x.com/i/flow/signup'); + +UPDATE `cp_podcasts_platforms` +SET `platform_slug` = 'x' +WHERE `platform_slug` = 'twitter'; + +DELETE FROM `cp_platforms` WHERE `slug` = 'twitter'; + +-- add buymeacoffee and kofi as funding platforms +INSERT INTO `cp_platforms` (`slug`, `type`, `label`, `home_url`, `submit_url`) VALUES +('buymeacoffee', 'funding', 'Buy Me a Coffee', 'https://www.buymeacoffee.com/', 'https://www.buymeacoffee.com/signup'), +('kofi', 'funding', 'Ko-fi', 'https://ko-fi.com/', 'https://ko-fi.com/account/register'); diff --git a/conf/sql/v1.6.1.sql b/conf/sql/v1.6.1.sql new file mode 100644 index 0000000..ed94939 --- /dev/null +++ b/conf/sql/v1.6.1.sql @@ -0,0 +1,2 @@ +INSERT INTO `cp_platforms` (`slug`, `type`, `label`, `home_url`, `submit_url`) VALUES +('tiktok', 'social', 'Tiktok', 'https://www.tiktok.com/', 'https://www.tiktok.com/signup'); diff --git a/scripts/upgrade b/scripts/upgrade index f09323e..d85b355 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,11 +42,14 @@ fi # MOVE DATA TO __DATA_DIR__ #================================================= -if [ $(ynh_compare_current_package_version --comparison le --version "1.1.2~ynh2") ]; then +if ynh_compare_current_package_version --comparison le --version "1.1.2~ynh2"; then ynh_script_progression --message="Moving data..." --weight=3 mv $install_dir/public/media $data_dir chmod -R 644 $data_dir chgrp -R www-data $data_dir + + ynh_script_progression --message="Fixing migrations..." --weight=1 + ynh_mysql_execute_as_root --database=$db_name --sql="UPDATE cp_migrations SET class='Media\\Database\\Migrations\\AddMedia', namespace='Media' where class='App\\Database\\Migrations\\AddMedia'" fi #================================================= @@ -100,6 +103,13 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app php${phpversion} spark castopod:database-update popd +if ynh_compare_current_package_version --comparison le --version "1.6.5~ynh1"; then + # cf https://code.castopod.org/adaures/castopod/-/releases/v1.5.2 + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < "../conf/v1.5.2.sql" + # cf https://code.castopod.org/adaures/castopod/-/releases/v1.6.1 + ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < "../conf/v1.6.1.sql" +fi + #================================================= # END OF SCRIPT #=================================================