mirror of
https://github.com/YunoHost-Apps/castopod_ynh.git
synced 2024-09-03 18:16:14 +02:00
Run more migrations.
This commit is contained in:
parent
ed91ce3779
commit
e9272dd450
3 changed files with 27 additions and 1 deletions
14
conf/sql/v1.5.2.sql
Normal file
14
conf/sql/v1.5.2.sql
Normal file
|
@ -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');
|
2
conf/sql/v1.6.1.sql
Normal file
2
conf/sql/v1.6.1.sql
Normal file
|
@ -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');
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue