Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Ensure Docker loads local_postgres sql scripts in correct order #90

Merged
merged 3 commits into from
Jun 10, 2021

Conversation

obulat
Copy link
Contributor

@obulat obulat commented Jun 8, 2021

Fixes WordPress/openverse#1735

This PR adds numbers to the local_postgres sql script names to ensure that Docker executes them in the correct order.

This prepares us for adding audio db table by either adding it to the openledger_image_schema and renaming it to openledger_media_schema, or creating a new openledger_audio_schema.

Signed-off-by: Olga Bulat [email protected]

@obulat obulat requested a review from a team as a code owner June 8, 2021 08:00
@obulat obulat requested review from zackkrida and dhruvkb June 8, 2021 08:00
dhruvkb
dhruvkb previously approved these changes Jun 8, 2021
Copy link
Member

@dhruvkb dhruvkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've sometimes observed people using a numbering convention of using 10s place for categories and 1s place for individual scripts, like

10_airflow_user_db.sql
20_aws_s3_mock.sql
31_openledger_image_schema.sql
32_openledger_image_view.sql
33_openledger_old_image_schema.sql

Similarly scripts for audio that come later would be 4x.

I'm just putting this idea out there, I'm not sure such a convention applies here.

@zackkrida
Copy link
Member

Any additional zeroes are welcome 👍

To allow for future expansion

Signed-off-by: Olga Bulat <[email protected]>
@zackkrida
Copy link
Member

Great j000b, LGTM

@zackkrida zackkrida requested a review from dhruvkb June 9, 2021 16:02
Copy link
Member

@krysal krysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learning about that directory for initialization scripts in the postgres image, interesting! Looks good.

@obulat obulat merged commit 01e76a7 into main Jun 10, 2021
@obulat obulat deleted the local_sql_order branch June 10, 2021 06:57
@zackkrida zackkrida added the 🛠 goal: fix Bug fix label Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Quality] Ensure correct loading of local sql
4 participants