From f7e158a83cf97b5dfe51b418c9644c5df79d244b Mon Sep 17 00:00:00 2001 From: Tom Hombergs Date: Fri, 1 Mar 2019 16:24:24 +0100 Subject: [PATCH] added missing flyway and liquibase scripts --- .../db/changelog/db.changelog-master.yaml | 103 ++++++++++++++++++ .../resources/db/migration/V001__schema.sql | 24 ++++ 2 files changed, 127 insertions(+) create mode 100644 spring-boot/spring-boot-testing/src/main/resources/db/changelog/db.changelog-master.yaml create mode 100644 spring-boot/spring-boot-testing/src/main/resources/db/migration/V001__schema.sql diff --git a/spring-boot/spring-boot-testing/src/main/resources/db/changelog/db.changelog-master.yaml b/spring-boot/spring-boot-testing/src/main/resources/db/changelog/db.changelog-master.yaml new file mode 100644 index 0000000..8127a00 --- /dev/null +++ b/spring-boot/spring-boot-testing/src/main/resources/db/changelog/db.changelog-master.yaml @@ -0,0 +1,103 @@ +databaseChangeLog: +- preConditions: + - runningAs: + username: sa + +- changeSet: + id: 1 + author: hombergs + changes: + - createTable: + tableName: booking + columns: + - column: + name: id + type: bigint + autoIncrement: true + constraints: + primaryKey: true + nullable: false + - column: + name: customer_id + type: bigint + - column: + name: flight_number + type: varchar(50) + constraints: + nullable: false + +- changeSet: + id: 2 + author: hombergs + changes: + - createTable: + tableName: customer + columns: + - column: + name: id + type: bigint + autoIncrement: true + constraints: + primaryKey: true + nullable: false + - column: + name: name + type: varchar(50) + constraints: + nullable: false + +- changeSet: + id: 3 + author: hombergs + changes: + - createTable: + tableName: flight + columns: + - column: + name: flight_number + type: varchar(50) + constraints: + nullable: false + - column: + name: airline + type: varchar(50) + constraints: + nullable: false + + +- changeSet: + id: 4 + author: hombergs + changes: + - createTable: + tableName: user + columns: + - column: + name: id + type: bigint + autoIncrement: true + constraints: + primaryKey: true + nullable: false + - column: + name: name + type: varchar(50) + constraints: + nullable: false + - column: + name: email + type: varchar(50) + constraints: + nullable: false + - column: + name: registration_date + type: timestamp + constraints: + nullable: false + +- changeSet: + id: 5 + author: hombergs + changes: + - createSequence: + sequenceName: hibernate_sequence \ No newline at end of file diff --git a/spring-boot/spring-boot-testing/src/main/resources/db/migration/V001__schema.sql b/spring-boot/spring-boot-testing/src/main/resources/db/migration/V001__schema.sql new file mode 100644 index 0000000..e654383 --- /dev/null +++ b/spring-boot/spring-boot-testing/src/main/resources/db/migration/V001__schema.sql @@ -0,0 +1,24 @@ +create table booking ( + id bigint, + customer_id bigint, + flight_number varchar +); + +create table customer ( + id bigint, + name varchar +); + +create table flight ( + flight_number varchar, + airline varchar +); + +create table user ( + id bigint, + name varchar, + email varchar, + registration_date timestamp +); + +create sequence hibernate_sequence; \ No newline at end of file