Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit858d00c

Browse files
Remove unused images and minor fixes in formatting
1 parent7b8cd35 commit858d00c

14 files changed

+56
-8
lines changed

‎flyway-and-spring-boot/text-based-guide/flyway-and-spring-boot.md‎

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,31 +158,77 @@ Amplicode Explorer позволяет добавить необходимые с
158158
Для этого необходимо:
159159
* Добавить плагин в файл `build.gradle`
160160

161-
``` yaml
161+
```groovy
162162
plugins {
163-
id "org.flywaydb.flyway" version "10.15.2"
163+
id "org.flywaydb.flyway" version "10.15.2"
164164
}
165165
```
166166

167167
* Добавить зависимость для работы с PostgreSQL
168168

169-
``` yaml
169+
```groovy
170170
dependencies {
171-
runtimeOnly 'org.postgresql:postgresql'
171+
runtimeOnly 'org.postgresql:postgresql'
172172
}
173173
```
174174

175175
* Указать необходимые параметры для подключения
176176

177-
``` yaml
177+
```groovy
178178
buildscript {
179-
dependencies {
180-
classpath("org.flywaydb:flyway-database-postgresql:10.10.0")
179+
dependencies {
180+
classpath("org.flywaydb:flyway-database-postgresql:10.10.0")
181181
}
182182
}
183183
```
184184

185-
``` yaml
185+
```groovy
186+
flyway {
187+
url = 'jdbc:postgresql://localhost:5432/blog'
188+
user = 'root'
189+
password = 'root'
190+
}
191+
```
192+
193+
В результате файл `build.gradle` будет выглядеть слебдующим образом:
194+
195+
```groovy
196+
buildscript {
197+
dependencies {
198+
classpath("org.flywaydb:flyway-database-postgresql:10.10.0")
199+
}
200+
}
201+
202+
plugins {
203+
id 'java'
204+
id 'org.springframework.boot' version '3.2.5'
205+
id 'io.spring.dependency-management' version '1.1.4'
206+
id 'org.flywaydb.flyway' version '10.10.0'
207+
}
208+
209+
group = 'io.amplicode'
210+
version = '0.0.1-SNAPSHOT'
211+
212+
java {
213+
sourceCompatibility = '17'
214+
}
215+
216+
repositories {
217+
mavenCentral()
218+
}
219+
220+
dependencies {
221+
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
222+
runtimeOnly 'org.postgresql:postgresql'
223+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
224+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
225+
implementation 'org.flywaydb:flyway-core'
226+
}
227+
228+
tasks.named('test') {
229+
useJUnitPlatform()
230+
}
231+
186232
flyway {
187233
url = 'jdbc:postgresql://localhost:5432/blog'
188234
user = 'root'
@@ -279,7 +325,9 @@ flyway {
279325
Для этого необходимо:
280326
* Выбрать скрипты, относящиеся к изменению пользователя (1)
281327
* В верхней панели выбрать действие переноса скриптов в новый файл миграции (2):
328+
282329
![](images/select-scripts-user.png)
330+
283331
* Задать название каждому из файлов
284332

285333
![](images/changelog-names.png)
Binary file not shown.
Binary file not shown.
Binary file not shown.
-43.1 KB
Binary file not shown.
-89.3 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-40.6 KB
Binary file not shown.
-391 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp