added_liquibase
This commit is contained in:
parent
bfa87a5f9b
commit
b538df61ab
2 changed files with 17 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import liquibase.integration.spring.SpringLiquibase;
|
||||||
import net.javacrumbs.shedlock.core.LockProvider;
|
import net.javacrumbs.shedlock.core.LockProvider;
|
||||||
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
|
import net.javacrumbs.shedlock.provider.jdbctemplate.JdbcTemplateLockProvider;
|
||||||
import net.javacrumbs.shedlock.spring.ScheduledLockConfiguration;
|
import net.javacrumbs.shedlock.spring.ScheduledLockConfiguration;
|
||||||
|
|
@ -62,4 +63,12 @@ public class AppConfig {
|
||||||
public LockProvider lockProvider(@Qualifier("datasource") DataSource dataSource) {
|
public LockProvider lockProvider(@Qualifier("datasource") DataSource dataSource) {
|
||||||
return new JdbcTemplateLockProvider(dataSource);
|
return new JdbcTemplateLockProvider(dataSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public SpringLiquibase liquibase(@Qualifier("datasource") DataSource dataSource) {
|
||||||
|
SpringLiquibase liquibase = new SpringLiquibase();
|
||||||
|
liquibase.setDataSource(dataSource);
|
||||||
|
liquibase.setChangeLog("classpath:config/changelog-master.xml");
|
||||||
|
return liquibase;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
8
backend/src/main/resources/config/changelog-master.xml
Normal file
8
backend/src/main/resources/config/changelog-master.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<databaseChangeLog
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||||
|
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
|
||||||
|
|
||||||
|
</databaseChangeLog>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue