Honor GEONODE_DATABASE_SCHEMA when initializing the database#14002
Draft
Honor GEONODE_DATABASE_SCHEMA when initializing the database#14002
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
…tilities Co-authored-by: etj <717359+etj@users.noreply.github.com>
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @copilot on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
Copilot
AI
changed the title
[WIP] Fix GEONODE_DATABASE_SCHEMA not applied during database creation
Honor GEONODE_DATABASE_SCHEMA when initializing the database
Feb 27, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GEONODE_DATABASE_SCHEMAandGEONODE_GEODATABASE_SCHEMAwere defined in.envfiles but never consumed — all database objects always landed in thepublicschema regardless of configuration.Changes
geonode/settings.pyGEONODE_DATABASE_SCHEMA/GEONODE_GEODATABASE_SCHEMA(default:"public") and injects them as PostgreSQLsearch_pathviaOPTIONS["options"]OPTIONSdict was shared by reference with the default database, causing schema settings to silently overwrite each othergeonode/utils.pyget_db_schema(db_settings)— extracts the active schema from a DjangoDATABASESentry by readingsearch_pathfromOPTIONS["options"]geonode/base/apps.pycreate_geonode_db_schema()to thepre_migratesignal so the configured schema is created (CREATE SCHEMA IF NOT EXISTS) before Django applies migrations^[A-Za-z_][A-Za-z0-9_$]*$before interpolating into SQLgeonode/br/(backup/restore)get_tables,truncate_tables,dump_db,remove_existing_tablesnow accept adb_schemaparameter (default"public") instead of hardcoding'public'backup.pyandrestore.pypassget_db_schema(datastore)/get_db_schema(settings.DATABASES["default"])at call sitesOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.