Skip to content

Commit

Permalink
DAT-17834 Ephemeral AWS infra for liquibase-test-harness (#819)
Browse files Browse the repository at this point in the history
* ✨ (aws-weekly.yml): Add AWS Weekly Cloud Database Test Execution workflow for testing Cloud Databases with test-harness using Terraform Action
🔧 (aws-weekly.yml): Configure workflow to run every Sunday at 6:00 AM and allow manual triggers with specified test classes and databases to start up
🚀 (aws-weekly.yml): Implement jobs for setup, deploying ephemeral cloud infrastructure, initializing MySQL databases, and running tests on various database platforms and versions

✨ Add support for running tests on different database platforms and versions using Maven
🔧 Update test run configurations to include database platform, version, username, password, and URL
🔧 Add support for running tests on AWS Aurora database platform
🔧 Include logic to archive test results for AWS RDS databases
🔧 Implement logic to destroy ephemeral cloud infrastructure after testing phase

* 🔧 (aws-weekly.yml): Update schedule to execute workflow every Sunday at 4:00 AM instead of 6:00 AM
🔧 (aws-weekly.yml): Refactor workflow to include support for various database types in the test execution process

* ✨ (aws-weekly.yml): add support for AWS MySQL database option in the workflow configuration.

* 🔧 (aws-weekly.yml): Update condition for aws_postgresql to exclude 'postgresql:aurora' and include 'postgresql' for deployment decision-making. Remove unnecessary whitespace at the end of the file.

* 🐛 (aws-weekly.yml): fix condition for aws_postgresql to correctly check for 'postgresql' database type and exclude 'postgresql:aurora' from the check

* 🔧 (aws-weekly.yml): add permissions for contents and id-token to improve security and access control in the workflow job.

* 📝 (aws-weekly.yml): remove unnecessary concurrency key from workflow configuration to improve readability and maintainability

* 🔧 (aws-weekly.yml): Update secret-ids format for mysql and aurora database connections to include correct resource id suffix
🔧 (aws-weekly.yml): Remove unnecessary secret-ids for other database connections to streamline the workflow and improve readability

* 🔧 (aws-weekly.yml): add support for fetching different AWS secrets based on the matrix version (aws or aurora) to improve flexibility and security in accessing database credentials.

* 🔧 (aws-weekly.yml): Update the reference to the ephemeral-cloud-infra.yml workflow to use the master branch instead of a specific branch for consistency and stability. Also, adjust the conditions for the aws_postgresql variable to include versions 12, 13, and 14 for better compatibility.

* 🔧 (aws-weekly.yml): Update the version of ephemeral-cloud-infra.yml to DAT-17834 for both deploy and destroy jobs to align with the changes made in the referenced file.

* 🔧 (aws-weekly.yml): Update conditional statements to fetch AWS secrets based on database platform and version selected during setup. Adjust database cleanup and initialization steps accordingly for MySQL databases on AWS and Aurora.

* 🔧 (aws-weekly.yml): Update workflow to use 'needs' instead of 'steps' to access outputs for databasePlatform and databaseVersion to ensure correct conditional execution based on dependencies.

🔧 (aws-weekly.yml): Update references to 'steps.setup.outputs' to 'needs.setup.outputs' to correctly access outputs from previous job steps.

* 🔧 (aws-weekly.yml): Refactor GitHub workflow to use 'steps' instead of 'needs' for accessing outputs from previous steps. This ensures correct data retrieval for database platform and version configurations.

⬆️ (aws-weekly.yml): Update references from 'needs.setup.outputs' to 'steps.setup.outputs' to align with workflow changes and improve consistency.

* 🔧 (aws-weekly.yml): update job dependencies to include deploy-ephemeral-cloud-infra before test job for proper execution order

* 🔧 (aws-weekly.yml): Remove unnecessary database cleanup steps to streamline workflow and improve efficiency
🔧 (aws-weekly.yml): Simplify database initialization steps for different database platforms to enhance maintainability and readability

* 🔧 (aws-weekly.yml): refactor workflow to use a matrix for database versions instead of individual conditions for 'aws' and 'aurora' versions

* 🔧 (aws-weekly.yml): update liquibase changeLogFile to include "_cloud" suffix for cloud databases to differentiate from regular databases
🔧 (aws-weekly.yml): update liquibase url to use TH_AURORA_MYSQLURL for aurora database version
🔧 (aws-weekly.yml): add new mysql_cloud.sql file with initial SQL scripts for cloud database tables "authors" and "posts"

* 🔧 (aws-weekly.yml): Update conditional statements to fetch AWS secrets only for MySQL databases when the version is 'aws' or 'aurora'

* 📝 (mssql.sql): add USE lbcat; statement to specify the database to use before executing SQL commands for better clarity and consistency

* 📝 (mssql.sql): remove unnecessary USE lbcat; statement and fix DROP TABLE IF EXISTS syntax to improve script readability and maintainability

* 🔧 (aws-weekly.yml): Remove redundant database initialization steps for 'aws' and 'aurora' versions to streamline workflow and avoid unnecessary configurations.

* 🔧 (aws-weekly.yml): add conditional database initialization step for AWS and Aurora versions using Liquibase

* 🔧 (aws-weekly.yml): remove unnecessary database initialization steps for mysql due to mysql driver issue on GitHub actions.

* 🔧 (aws-weekly.yml): Remove redundant AWS secrets retrieval steps for MySQL databases and unnecessary comment to streamline workflow and improve readability.

* ✨ (aws-weekly.yml): Add a new line to improve readability and maintain consistency in the workflow file
📝 (mssql.sql): Add database creation and switching commands for better database management and setup

* test

* 🔧 (aws-weekly.yml): add TH_MSSQLURL_HOST secret to support MSSQL host configuration for sqlcmd execution

* 🔧 (aws-weekly.yml): update TH_MSSQLURL_HOST secret to include correct resource ID for MSSQL host configuration

* 🔧 (aws-weekly.yml): transform TH_MSSQLURL_HOST value to replace colon with comma for sqlcmd connection
🔧 (mssql.sql): remove explicit USE [lbcat] statement as the database is now created dynamically during workflow execution

* 🔧 (aws-weekly.yml): simplify sqlcmd command by removing unnecessary variable transformation and echo statements

* test

* 🔧 (aws-weekly.yml): Update schedule to execute the workflow every Sunday at 4:00 AM instead of 6:00 AM
🔧 (aws-weekly.yml): Update the version of the ephemeral-cloud-infra.yml workflow to DAT-17834
🔧 (aws-weekly.yml): Add support for different database types in the deploy-ephemeral-cloud-infra job
🔧 (aws-weekly.yml): Add permissions for contents read and id-token write in the init-mysql job
🔧 (aws-weekly.yml): Add configuration for different database types in the init-mysql job
🔧 (aws-weekly.yml): Add configuration for different database types in the test job
🔧 (aws-weekly.yml): Add permissions for contents read and id-token write in the test job
🔧 (aws-weekly.yml): Update the configuration to get AWS secrets based on database platform and version in the test job

🔧 (aws-weekly.yml): Update GitHub Action to install a SQL Server suite of tools and run sqlcmd for MSSQL platform
🔧 (aws-weekly.yml): Add conditional logic to destroy ephemeral cloud infrastructure based on specified databases in inputs

* 🔧 (aws-weekly.yml): Update workflow to use the main branch for ephemeral-cloud-infra.yml instead of DAT-17834 branch. Remove trailing whitespace.

* 🔧 (aws-weekly.yml): Add missing newline characters for better readability and maintainability.

* DAT-17834. fix for postgresql aurora failures.

* DAT-17834. fix for postgresql aurora failures.

---------

Co-authored-by: Pavlo Tytarchuk <ptyta@softserveinc.com>
  • Loading branch information
jandroav and PavloTytarchuk committed Jun 5, 2024
1 parent e9c9ba7 commit c6ce273
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 74 deletions.
182 changes: 108 additions & 74 deletions .github/workflows/aws-weekly.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Terraform Action to test Cloud Databases with test-harness

name: AWS Weekly Cloud Database Test Execution
concurrency: aws-run
on:
# Triggers the workflow on a schedule for the main branch. Also allows for manual triggers
# Execute every sunday at 6:00 AM
# Execute every sunday at 4:00 AM
schedule:
- cron: '0 6 * * 0'
- cron: '0 4 * * 0'
workflow_dispatch:
inputs:
testClasses:
Expand Down Expand Up @@ -38,15 +37,24 @@ jobs:
uses: actions/checkout@v4

deploy-ephemeral-cloud-infra:
uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@DAT-17834
uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@main
secrets: inherit
with:
deploy: true
aws_test_harness: true
aws_postgresql: ${{ contains(inputs.databases, 'postgresql:12') || contains(inputs.databases, 'postgresql:13') || contains(inputs.databases, 'postgresql:14')}}
aws_oracle: ${{ contains(inputs.databases, 'oracle') }}
aws_mariadb: ${{ contains(inputs.databases, 'mariadb') }}
aws_aurora_mysql: ${{ contains(inputs.databases, 'mysql:aurora') }}
aws_mssql: ${{ contains(inputs.databases, 'mssql') }}
aws_aurora_postgres: ${{ contains(inputs.databases, 'postgresql:aurora') }}
aws_mysql: ${{ contains(inputs.databases, 'mysql:aws') }}

init-mysql:
runs-on: ubuntu-latest
needs: [deploy-ephemeral-cloud-infra]
permissions:
contents: read
id-token: write
container:
image: liquibase/liquibase:latest
env:
Expand All @@ -69,52 +77,44 @@ jobs:
role-to-assume: ${{ secrets.AWS_DEV_GITHUB_OIDC_ROLE_ARN_BUILD_LOGIC }}
aws-region: us-east-1

- name: Configure Test
id: setup
uses: actions/github-script@v7.0.1
with:
script: |
let splitValues = "${{ matrix.database }}".split(":")
core.setOutput("databasePlatform", splitValues[0]);
core.setOutput("databaseVersion", splitValues[1]);
- name: Get AWS secrets
if: ${{ matrix.version == 'aws' && matrix.database == 'mysql'}}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_MYSQLURL_8_0, /testautomation/db_details/aws_mysql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_AURORA_MYSQLURL, /testautomation/db_details/aurora_mysql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_ORACLEURL_19, /testautomation/db_details/aws_oracle_19_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_12, /testautomation/db_details/aws_postgresql_12_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_13, /testautomation/db_details/aws_postgresql_13_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_14, /testautomation/db_details/aws_postgresql_14_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_MARIADBURL_10_6, /testautomation/db_details/aws_mariadb_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_MSSQLURL, /testautomation/db_details/aws_mssql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_AURORA_POSTGRESQLURL, /testautomation/db_details/aurora_postgresql_jdbc${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_MYSQLURL_8_0, /testautomation/db_details/aws_mysql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- name: Get AWS secrets
if: ${{ matrix.version == 'aurora' && matrix.database == 'mysql'}}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_AURORA_MYSQLURL, /testautomation/db_details/aurora_mysql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
#This additional init step is required because of mysql driver issue on GH actions
- name: Install Dependencies
run: lpm update && lpm add mysql

- name: Clean AWS MySQL Database
uses: liquibase-github-actions/drop-all@v4.25.1
if: ${{ matrix.version == 'aws' }}
with:
url: "${{ env.TH_MYSQLURL_8_0 }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- name: Init Database
if: ${{ matrix.version == 'aws' }}
run: liquibase --classpath="src/test/resources/init-changelogs/aws" --changeLogFile="${{ matrix.database }}.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ env.TH_MYSQLURL_8_0 }}" update

- name: Clean Aurora MySQL Database
uses: liquibase-github-actions/drop-all@v4.25.1
if: ${{ matrix.version == 'aurora' }}
with:
url: "${{ env.TH_AURORA_MYSQLURL }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"
if: ${{ matrix.version == 'aws' && matrix.database == 'mysql'}}
run: liquibase --classpath="src/test/resources/init-changelogs/aws" --changeLogFile="${{ matrix.database }}_cloud.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ env.TH_MYSQLURL_8_0 }}" update

- name: Init Database
if: ${{ matrix.version == 'aurora' }}
run: liquibase --classpath="src/test/resources/init-changelogs/aws" --changeLogFile="${{ matrix.database }}.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ env.TH_AURORA_MYSQLURL }}" update
if: ${{ matrix.version == 'aurora' && matrix.database == 'mysql'}}
run: liquibase --classpath="src/test/resources/init-changelogs/aws" --changeLogFile="${{ matrix.database }}_cloud.sql" --username="${{ secrets.TH_DB_ADMIN }}" --password="${{ secrets.TH_DB_PASSWD }}" --url="${{ env.TH_AURORA_MYSQLURL }}" update

test:
needs: [init-mysql, setup]
needs: [deploy-ephemeral-cloud-infra, init-mysql, setup]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -133,14 +133,64 @@ jobs:
let splitValues = "${{ matrix.database }}".split(":")
core.setOutput("databasePlatform", splitValues[0]);
core.setOutput("databaseVersion", splitValues[1]);
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_DEV_GITHUB_OIDC_ROLE_ARN_BUILD_LOGIC }}
aws-region: us-east-1

- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'mysql' && steps.setup.outputs.databaseVersion == 'aws' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_MYSQLURL_8_0, /testautomation/db_details/aws_mysql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'mysql' && steps.setup.outputs.databaseVersion == 'aurora' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_AURORA_MYSQLURL, /testautomation/db_details/aurora_mysql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- uses: liquibase-github-actions/drop-all@v4.25.1
- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
url: "${{ env.TH_ORACLEURL_19 }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"
secret-ids: |
TH_ORACLEURL_19, /testautomation/db_details/aws_oracle_19_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_PGRESURL_12, /testautomation/db_details/aws_postgresql_12_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_13, /testautomation/db_details/aws_postgresql_13_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_PGRESURL_14, /testautomation/db_details/aws_postgresql_14_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_MARIADBURL_10_6, /testautomation/db_details/aws_mariadb_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_MSSQLURL, /testautomation/db_details/aws_mssql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
TH_MSSQLURL_HOST, /testautomation/db_details/aws_mssql_host_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- name: Get AWS secrets
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }}
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
secret-ids: |
TH_AURORA_POSTGRESQLURL, /testautomation/db_details/aurora_postgresql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }}
- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }}
Expand All @@ -152,14 +202,6 @@ jobs:
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_ORACLEURL_19 }}"

- uses: liquibase-github-actions/drop-all@v4.25.1
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }}
with:
url: "${{ env[format('TH_PGRESURL_{0}', steps.setup.outputs.databaseVersion)] }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }}
with:
Expand All @@ -170,14 +212,6 @@ jobs:
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env[format('TH_PGRESURL_{0}', steps.setup.outputs.databaseVersion)] }}"

- uses: liquibase-github-actions/drop-all@v4.25.1
if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }}
with:
url: "${{ env.TH_MARIADBURL_10_6 }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }}
with:
Expand All @@ -188,13 +222,15 @@ jobs:
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_MARIADBURL_10_6 }}"

- uses: liquibase-github-actions/drop-all@v4.25.1
- name: Install a SQL Server suite of tools
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
uses: potatoqualitee/mssqlsuite@v1.7
with:
url: "${{ env.TH_MSSQLURL }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"
install: sqlengine, sqlclient, sqlpackage

- name: Run sqlcmd
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
run: sqlcmd -S ${{ env.TH_MSSQLURL_HOST }} -U ${{secrets.TH_DB_ADMIN}} -P ${{secrets.TH_DB_PASSWD}} -Q "CREATE DATABASE lbcat"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }}
Expand All @@ -206,14 +242,6 @@ jobs:
password: "${{secrets.TH_DB_PASSWD}}"
url: "${{ env.TH_MSSQLURL }}"

- uses: liquibase-github-actions/drop-all@v4.25.1
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }}
with:
url: "${{ env.TH_AURORA_POSTGRESQLURL }}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"

- uses: liquibase/liquibase-github-action@v7
if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }}
with:
Expand Down Expand Up @@ -283,9 +311,15 @@ jobs:
destroy-ephemeral-cloud-infra:
if: always()
needs: [ deploy-ephemeral-cloud-infra, test ]
uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@DAT-17834
uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@main
secrets: inherit
with:
destroy: true
stack_id: ${{ needs.deploy-ephemeral-cloud-infra.outputs.stack_id }}
aws_test_harness: true
aws_postgresql: ${{ contains(inputs.databases, 'postgresql:12') || contains(inputs.databases, 'postgresql:13') || contains(inputs.databases, 'postgresql:14')}}
aws_oracle: ${{ contains(inputs.databases, 'oracle') }}
aws_mariadb: ${{ contains(inputs.databases, 'mariadb') }}
aws_aurora_mysql: ${{ contains(inputs.databases, 'mysql:aurora') }}
aws_mssql: ${{ contains(inputs.databases, 'mssql') }}
aws_aurora_postgres: ${{ contains(inputs.databases, 'postgresql:aurora') }}
aws_mysql: ${{ contains(inputs.databases, 'mysql:aws') }}
7 changes: 7 additions & 0 deletions src/test/resources/harness-config-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ databasesUnderTest:
username: USERNAME
password: PASSWORD

- name: postgresql
prefix: aurora
version: 13
url: DBENDPOINT
username: USERNAME
password: PASSWORD

- name: postgresql
prefix: aurora
version: 16
Expand Down
37 changes: 37 additions & 0 deletions src/test/resources/init-changelogs/aws/mysql_cloud.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--liquibase formatted sql
--changeset liquibase:1 runAlways:true
DROP TABLE IF EXISTS `authors`;
CREATE TABLE `authors` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`birthdate` date NOT NULL,
`added` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--changeset liquibase:2 runAlways:true
INSERT INTO `authors` VALUES ('1','Eileen','Lubowitz','ppaucek@example.org','1991-03-04','2004-05-30 02:08:25'),
('2','Tamia','Mayert','shansen@example.org','2016-03-27','2014-03-21 02:52:00'),
('3','Cyril','Funk','reynolds.godfrey@example.com','1988-04-21','2011-06-24 18:17:48'),
('4','Nicolas','Buckridge','xhoeger@example.net','2017-02-03','2019-04-22 02:04:41'),
('5','Jayden','Walter','lillian66@example.com','2010-02-27','1990-02-04 02:32:00');

--changeset liquibase:3 runAlways:true
DROP TABLE IF EXISTS `posts`;
CREATE TABLE `posts` (
`id` int(11) NOT NULL,
`author_id` int(11) NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`content` text COLLATE utf8_unicode_ci NOT NULL,
`inserted_date` date
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--changeset liquibase:4 runAlways:true
INSERT INTO `posts` VALUES ('1','1','temporibus','voluptatum','Fugit non et doloribus repudiandae.','2015-11-18'),
('2','2','ea','aut','Tempora molestias maiores provident molestiae sint possimus quasi.','1975-06-08'),
('3','3','illum','rerum','Delectus recusandae sit officiis dolor.','1975-02-25'),
('4','4','itaque','deleniti','Magni nam optio id recusandae.','2010-07-28'),
('5','5','ad','similique','Rerum tempore quis ut nesciunt qui excepturi est.','2006-10-09');

0 comments on commit c6ce273

Please sign in to comment.