Draft
Conversation
added 5 commits
May 4, 2020 14:14
Schema modules import a shared Base instance, that holds the catalog for tables and classes assiociated with the open energy database. Previously in each schema module a Base class was defined and mapped classes would inherit from that class. Thus importing classes from different `egio.db_tables` modules had different associated Base classes. As a consequence I could not use the method `create_all` on the `metadata` attribute to create database tables across schemata.
The index argument results in a CREATE INDEX statement. By default PostgreSQL creates a B-tree index. I don't think this is intended. The geoalchemy.types.Geometry attribute `spatial_index` is True by default and indicates that a spatial index should be created.
See previous commit.
The sequence is referred to, but isn't created as far as I see it. I rewrote the class definition for one table following `Associating a Sequence as the Server Side Default` from the SQLAlchemy docs. The sequence will be created, but I'm not sure the sequence is setup as intended.
6 tasks
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.
The feature branch introduces a shared Base class among modules. It also contains numerous minor changes in mapped classes that seem to be necessary to create the database from this model in order to recreate the database structure and subsequently make a local copy of oedb data.