Adding liquibase yaml files for db schema

This commit is contained in:
anbu 2021-01-31 04:12:29 +00:00
parent 757a99a90a
commit 2aa3e9df9c
9 changed files with 238 additions and 0 deletions

View file

@ -0,0 +1,13 @@
databaseChangeLog:
- changeSet:
id: 20210120-hibernate-sequence
author: anbu
changes:
- createSequence:
cacheSize: 100
cycle: false
incrementBy: 1
minValue: 1
ordered: false
sequenceName: HIBERNATE_SEQUENCE
startValue: 1000

View file

@ -0,0 +1,26 @@
databaseChangeLog:
- changeSet:
id: 20210120-vets-table
author: anbu
changes:
- createTable:
tableName: vets
columns:
- column:
name: id
type: bigint
constraints:
primaryKey: true
nullable: false
- column:
name: first_name
type: varchar(30)
- column:
name: last_name
type: varchar(30)
- createIndex:
indexName: ix1_vets_last_name
tableName: vets
columns:
- column:
name: last_name

View file

@ -0,0 +1,23 @@
databaseChangeLog:
- changeSet:
id: 20210121-specialties-table
author: anbu
changes:
- createTable:
tableName: specialties
columns:
- column:
name: id
type: bigint
constraints:
primaryKey: true
nullable: false
- column:
name: name
type: varchar(30)
- createIndex:
indexName: ix1_speialties_name
tableName: specialties
columns:
- column:
name: name

View file

@ -0,0 +1,20 @@
databaseChangeLog:
- changeSet:
id: 20210122-vet-specialties-table
author: anbu
changes:
- createTable:
tableName: vet_specialties
columns:
- column:
name: vet_id
type: bigint
constraints:
foreignKeyName: fk_vet_specialties_vets
references: vets(id)
- column:
name: specialty_id
type: bigint
constraints:
foreignKeyName: fk_vet_specialties_specialities
references: specialties(id)

View file

@ -0,0 +1,23 @@
databaseChangeLog:
- changeSet:
id: 20210123-types-table
author: anbu
changes:
- createTable:
tableName: types
columns:
- column:
name: id
type: bigint
constraints:
primaryKey: true
nullable: false
- column:
name: name
type: varchar(30)
- createIndex:
indexName: ix1_types_name
tableName: types
columns:
- column:
name: name

View file

@ -0,0 +1,35 @@
databaseChangeLog:
- changeSet:
id: 20210124-owners-table
author: anbu
changes:
- createTable:
tableName: owners
columns:
- column:
name: id
type: bigint
constraints:
primaryKey: true
nullable: false
- column:
name: first_name
type: varchar(30)
- column:
name: last_name
type: varchar(30)
- column:
name: address
type: varchar(255)
- column:
name: city
type: varchar(80)
- column:
name: telephone
type: varchar(20)
- createIndex:
indexName: ix1_owners_last_name
tableName: owners
columns:
- column:
name: last_name

View file

@ -0,0 +1,40 @@
databaseChangeLog:
- changeSet:
id: 20210125-pets-table
author: anbu
changes:
- createTable:
tableName: pets
columns:
- column:
name: id
type: bigint
constraints:
primaryKey: true
nullable: false
- column:
name: name
type: varchar(30)
- column:
name: birth_date
type: date
- column:
name: type_id
type: bigint
constraints:
nullable: false
foreignKeyName: fk_pets_types
references: types(id)
- column:
name: owner_id
type: bigint
constraints:
nullable: false
foreignKeyName: fk_pets_owners
references: owners(id)
- createIndex:
indexName: ix1_pets_name
tableName: pets
columns:
- column:
name: name

View file

@ -0,0 +1,33 @@
databaseChangeLog:
- changeSet:
id: 20210125-visits-table
author: anbu
changes:
- createTable:
tableName: visits
columns:
- column:
name: id
type: bigint
constraints:
primaryKey: true
nullable: false
- column:
name: pet_id
type: bigint
constraints:
nullable: false
foreignKeyName: fk_visits_pets
references: pets(id)
- column:
name: visit_date
type: date
- column:
name: description
type: varchar(255)
- createIndex:
indexName: ix1_visits_pet_id
tableName: visits
columns:
- column:
name: pet_id

View file

@ -0,0 +1,25 @@
databaseChangeLog:
- include:
file: changelog/20210120-hibernate-sequence.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210120-vets.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210121-specialties.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210122-vet-specialties.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210123-types.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210124-owners.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210125-pets.yaml
relativeToChangelogFile: true
- include:
file: changelog/20210125-visits.yaml
relativeToChangelogFile: true