create table person

This commit is contained in:
uPagge 2021-03-07 15:10:50 +03:00
parent 2c64358df6
commit 9e01a3ecd6
No known key found for this signature in database
GPG Key ID: 964B40928E4C9088
5 changed files with 30 additions and 0 deletions

View File

@ -21,6 +21,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>

View 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

View 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>