LoginSignup
0
0

More than 3 years have passed since last update.

Eclipse上でFlywayを追加・設定・実行

Posted at

 EclipseプロジェクトにFlywayを追加・設定・実行までの手順

今回はmavenプロジェクトでflywayを追加などを説明

追加手順

pom.xmlにFlywayのdependencyを追加する
image.png

    <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
    </dependency>

接続設定

pom.xmlに

project > build > plugins の中にpluginを追加
image.png

        <plugin>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-maven-plugin</artifactId>
            <configuration>
                <user>user<user>
                <password>password</password>
                <url>jdbc:mysql://localhost:3306/databaseName?serverTimezone=UTC</url>
                <schemas>
                    <schema>schemaName</schema>
                </schemas>
            </configuration>
        </plugin>

実行

プロジェクトのrootフォルダーの中に「shift+MR」(shift + 右クリック)で「powershell。。。」をクリック

image.png

PowerShellを開いた後以下のコードを実行

./mvnw clean flyway:migrate

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0