-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create jobs database tables without init container (#4942)
* Refactor jobs and configs database initialization * Add unit tests * Format code * Refactor code * Update document * Fix tests * Add back init script to create db and user permission * Remove old schema files * Dry database instance implementations * Revert unnecessary changes * Rename resource directories * Format code * Add readme * Move and rename database schema to jobs database schema * Introduce table schema interface * Rearrange packages * Format code * Address review comments * Show more logs for acceptance test * Do not depend on service uuid for db readiness
- Loading branch information
Showing
39 changed files
with
764 additions
and
269 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM postgres:13-alpine | ||
|
||
COPY src/main/resources/schema.sql /docker-entrypoint-initdb.d/000_init.sql | ||
COPY src/main/resources/init.sql /docker-entrypoint-initdb.d/000_init.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# How to Create a New Database | ||
|
||
Check `io.airbyte.db.instance.configs` for example. | ||
|
||
- Create a new package under `io.airbyte.db.instance` with the name of the database. | ||
- Create the database schema enum that defines all tables in the database. | ||
- Write a SQL script that initializes the database. | ||
- The default path for this file is `resource/<db-name>_database/schema.sql`. | ||
- Implement the `DatabaseInstance` interface that initializes the database by executing the initialization script. | ||
- [Optional] For each table, create a constant class that defines the table and the columns in jooq. | ||
- This is necessary only if you plan to use jooq to query the table. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.