Flyway version management database common errors and solutions

2022-12-06 16:42:26

<p> Flyway is a database version of management tool that realizes the automation upgrade of DB Migration through SQL scripts. It supports independent operation. It can also integrate with the construction tool or Spring development environment.</p> <p> Summarize common errors in the actual development process, share solutions and suggestions:</p> <p> l migrate failed, prompting the SQL script error</p> <p> Solution: Run the Flyway command to repair to repair the upgrade information in the database, correct the SQL error and then migrate again</p> <p> Suggestion: Before running Migrate, make sure that SQL is correct first.</p> <p> l migrate does not run the additional SQL script</p> <p> Solution: SQL script naming follows rules, such as v1.0.0_init.sql</p> <p> L Migrate failed to run, and the prompt was not enough.</p> <p> Solution: Account needs to have the right to correspond to the SQL script, such as Create Table</p> <p> l migrate failed, prompting the database is not empty, &quot;Found Non-Empty Schema (s)&quot;</p> <p> Solution: Run the Flyway command baseline initialization according to the prompts.</p> <p> Suggestion: Clear the database and initialize from the empty database.</p> <p> l Prompt that you can&#39;t find the database, &quot;UNKOWN DATABASE &#39;XXX&#39;&quot;</p> <p> Solution: You need to create an empty database first.</p> <p> After l spring, after integrated Flyway, clear the data and start failure</p> <p> Solution: Confirm whether ValidationQuery is Select 1 from Dual or a specified data table. You need to use Dual when you database</p> <p> l spring After integrated Flyway, start running an error</p> <p> Solution: Bean that depends on the database needs to be specified after Flyway to complete the Migrate</p> <p> l SQL script v1.0__xxx.sql is not running</p> <p> Solution: Flyway via the version number unique script. If you first run Baseline, Flyway will automatically create version 1.0</p> <p> Suggestion: 1, start starting from the empty database, do not run Baseline</p> <p> Suggestion: 2, initialize the SQL script version number starting from V1.0.1, using three digits.</p> <p> &nbsp;</p> <p> &nbsp;</p>


Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us

high perspicacity