Skip to content

Commit

Permalink
syncing liquibase to be in sync with other services
Browse files Browse the repository at this point in the history
  • Loading branch information
rajadilipkolli committed Aug 31, 2023
1 parent 1080c28 commit 0359374
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,56 +1,5 @@
# https://docs.liquibase.com/concepts/changelogs/yaml-format.html
databaseChangeLog:
- property:
dbms: postgresql
name: string.type
value: text
- property:
dbms: "!postgresql"
name: string.type
value: varchar(255)
- changeSet:
author: rajakolli
id: createTable-products
context: Creates DDL Script for product
preConditions:
- onFail: MARK_RAN
not:
- sequenceExists:
sequenceName: products_seq
- tableExists:
tableName: products
createSequence:
sequenceName: products_seq
startValue: '1'
incrementBy: '1'
createTable:
columns:
- column:
constraints:
nullable: 'false'
primaryKey: 'true'
primaryKeyName: pk_products
name: id
type: BIGINT
defaultValueSequenceNext: 'products_seq'
- column:
constraints:
nullable: 'false'
name: code
type: ${string.type}
- column:
constraints:
nullable: 'false'
name: product_name
type: ${string.type}
- column:
name: description
type: ${string.type}
- column:
name: price
type: 'NUMERIC(19,2)'
tableName: products
addUniqueConstraint:
columnNames: code
constraintName: uc_products_code
tableName: products
- includeAll:
path: migration/
errorIfMissingOrEmpty: true
relativeToChangelogFile: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# https://docs.liquibase.com/concepts/changelogs/yaml-format.html
databaseChangeLog:
- property:
dbms: postgresql
name: string.type
value: text
- property:
dbms: "!postgresql"
name: string.type
value: varchar(255)
- changeSet:
author: rajakolli
id: createTable-products
context: Creates DDL Script for product
preConditions:
- onFail: MARK_RAN
not:
- sequenceExists:
sequenceName: products_seq
- tableExists:
tableName: products
createSequence:
sequenceName: products_seq
startValue: '1'
incrementBy: '1'
createTable:
columns:
- column:
constraints:
nullable: 'false'
primaryKey: 'true'
primaryKeyName: pk_products
name: id
type: BIGINT
defaultValueSequenceNext: 'products_seq'
- column:
constraints:
nullable: 'false'
name: code
type: ${string.type}
- column:
constraints:
nullable: 'false'
name: product_name
type: ${string.type}
- column:
name: description
type: ${string.type}
- column:
name: price
type: 'NUMERIC(19,2)'
tableName: products
addUniqueConstraint:
columnNames: code
constraintName: uc_products_code
tableName: products

0 comments on commit 0359374

Please sign in to comment.