Skip to content

Allow 8Knot to be compatible with both legacy and new CollectOSS database schemas#1176

Merged
MoralCode merged 4 commits into
devfrom
collectoss_schema_migration
Jun 12, 2026
Merged

Allow 8Knot to be compatible with both legacy and new CollectOSS database schemas#1176
MoralCode merged 4 commits into
devfrom
collectoss_schema_migration

Conversation

@EngCaioFonseca

@EngCaioFonseca EngCaioFonseca commented May 29, 2026

Copy link
Copy Markdown
Contributor

This PR adapts 8knot for the new schema from CollectOSS by adding its schema name into the search path, as the first one to be used, and then defaults to augur_data if it doesn't work.

Pull Request Change Description

Generative AI disclosure

Please select one option:

  • This contribution was NOT assisted or created by Generative AI tools.
  • This contribution was assisted or created by Generative AI tools.

If AI tools were used, please provide details below:
- What tools were used? Claude-Opus -4.8
- How were these tools used? Finding the places to fix for the new schema.
- Did you review these outputs before submitting this PR? Yes.

@EngCaioFonseca EngCaioFonseca self-assigned this May 29, 2026
@EngCaioFonseca EngCaioFonseca moved this from Backlog to Testing | Waiting on PR response | Blocked in Aspen Project Board May 29, 2026
@EngCaioFonseca EngCaioFonseca marked this pull request as draft May 29, 2026 14:20
@EngCaioFonseca EngCaioFonseca marked this pull request as ready for review June 2, 2026 14:13

@MoralCode MoralCode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry to do this to you, but the new name has changed from collection_data to just data. Can you update this PR?

env_password = os.getenv("POSTGRES_PASSWORD", "password")
env_port = os.getenv("CACHE_PORT", "5432")
env_schema = os.getenv("CACHE_SCHEMA", "augur_data")
env_schema = os.getenv("CACHE_SCHEMA", "data,augur_data")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is 8knot changing its cache schema names too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should we, or should we not? I was just working on changing or adapting everything to it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is an internal implementation detail that should only matter within 8knot. Also the cache gets erased regularly, so if this isnt already part of this PR, we can probably address it in a follow-up PR later

This change might be something thats worth doing as part of whatever PR series we do to rename 8knot internal stuff to remove old naming for the CollectOSS db.

@MoralCode MoralCode changed the title Adding collection_data to the search_path, and removing augur_data from files Allow 8Knot to be compatible with both legacy and new CollectOSS database schemas Jun 12, 2026

@MoralCode MoralCode left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested this with databases that used each different schema (prod read - old schema, and my local dev - with new schema and the materialized views that are needed)

i was using the stock compose file with minor irrelevant tweaks. No configured cache volume, so nothing that needed to be reset run to run.

Either way, 8Knot seems to function about the same on either database. Id say this is good to merge

@MoralCode MoralCode linked an issue Jun 12, 2026 that may be closed by this pull request
@MoralCode MoralCode merged commit 75a8328 into dev Jun 12, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Testing | Waiting on PR response | Blocked to Done in Aspen Project Board Jun 12, 2026
@MoralCode MoralCode deleted the collectoss_schema_migration branch June 12, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

decouple 8Knot from hard coded Schemas, enable user-defined schemas

2 participants