Skip to content

Fix: The Db is dropped even when the PS_ERASE_DB is set to 0 - #451

Open
PululuK wants to merge 2 commits into
PrestaShop:masterfrom
PululuK:fi/install-script-db-drop
Open

Fix: The Db is dropped even when the PS_ERASE_DB is set to 0#451
PululuK wants to merge 2 commits into
PrestaShop:masterfrom
PululuK:fi/install-script-db-drop

Conversation

@PululuK

@PululuKPululuK commented Oct 12, 2025

Copy link
Copy Markdown
Member
QuestionsAnswers
Description?The Db is droped even the PS_ERASE_DB is setted 0
Type?bug fix
BC breaks?no
Deprecations?no
Fixed ticket?
Sponsor companyEvolutive
How to test?Make sure that DB is droped only when PS_ERASE_DB is 0

Comment threadbase/config_files/docker_run.sh Outdated
@nicosombnicosomb changed the title Fix: The Db is droped even the PS_ERASE_DB is setted 1Fix: The Db is dropped even the PS_ERASE_DB is setted 1Oct 13, 2025
Co-authored-by: Nicolas Lœuillet <nicolas@loeuillet.org>
@PululuK

Copy link
Copy Markdown
MemberAuthor

Hello @Quetzacoalt91
J'espere que ça va :)
C'est assez critique si vous pouvez nous aider pour une release rapidement svp
Merci d'avance

@Quetzacoalt91

Copy link
Copy Markdown
Member

Hello @PululuK,

Can you please describe what was the issue you're trying to solve?
The title seems logical to me. If you set PS_ERASE_DB as 1, the database will be dropped at the first use of the container.

@PululuKPululuK changed the title Fix: The Db is dropped even the PS_ERASE_DB is setted 1Fix: The Db is dropped even the PS_ERASE_DB is setted 0Oct 13, 2025
@PululuK

Copy link
Copy Markdown
MemberAuthor

Hello @PululuK,

Can you please describe what was the issue you're trying to solve? The title seems logical to me. If you set PS_ERASE_DB as 1, the database will be dropped at the first use of the container.

oh sorry I just updated

echo "\n* Drop mysql database...";
echo "\n* Dropping existing database $DB_NAME..."
mysql -h $DB_SERVER -P $DB_PORT -u $DB_USER -p$DB_PASSWD -e "drop database if exists $DB_NAME;"
fi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was useful even if we did not trigger the auto installation of PrestaShop. Don't you think the parameter --db_clear=$PS_ERASE_DB would be enough here?

@PululuKPululuKOct 13, 2025

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Quetzacoalt91 if you don't need to use the auto installation, in this case you need to adapte your script using post-install-scripts

@SiraDIOPSiraDIOP self-assigned this Oct 16, 2025
@SiraDIOPSiraDIOP removed their assignment Oct 17, 2025

@SiraDIOPSiraDIOP left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @PululuK,

Thanks for your PR,
Could you give us clearer steps on how to test the pr, please?

Thanks

@tleontleon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you regenerate the base images so they implement your change ?

@SharakPLSharakPL changed the title Fix: The Db is dropped even the PS_ERASE_DB is setted 0Fix: The Db is dropped even when the PS_ERASE_DB is set to 0Oct 17, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

7 participants

@PululuK@Quetzacoalt91@nicosomb@tleon@SiraDIOP@ps-jarvis@boherm