mirror of
https://github.com/Example-uPagge/liquibase.git
synced 2024-06-14 12:22:25 +03:00
create table person
This commit is contained in:
parent
2c64358df6
commit
9e01a3ecd6
4
pom.xml
4
pom.xml
@ -21,6 +21,10 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter</artifactId>
|
<artifactId>spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.liquibase</groupId>
|
<groupId>org.liquibase</groupId>
|
||||||
<artifactId>liquibase-core</artifactId>
|
<artifactId>liquibase-core</artifactId>
|
||||||
|
8
src/main/resources/application.yaml
Normal file
8
src/main/resources/application.yaml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
url: jdbc:postgresql://localhost:5432/liquibase_example
|
||||||
|
username: postgres
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
|
password: 121314Ma
|
||||||
|
liquibase:
|
||||||
|
change-log: classpath:db/changelog/db.changelog-master.xml
|
18
src/main/resources/db/changelog/db.changelog-master.xml
Normal file
18
src/main/resources/db/changelog/db.changelog-master.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<databaseChangeLog
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
|
||||||
|
|
||||||
|
<changeSet id="create-table-person" author="uPagge">
|
||||||
|
<createTable tableName="person">
|
||||||
|
<column name="id" type="int" autoIncrement="true">
|
||||||
|
<constraints nullable="false" primaryKey="true"/>
|
||||||
|
</column>
|
||||||
|
<column name="name" type="varchar(64)"/>
|
||||||
|
<column name="telegram_id" type="int">
|
||||||
|
<constraints unique="true"/>
|
||||||
|
</column>
|
||||||
|
</createTable>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
</databaseChangeLog>
|
Loading…
Reference in New Issue
Block a user