Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/create-database-from-model #84

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

eosram
Copy link

@eosram eosram commented May 8, 2020

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.

eosram 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.
@eosram eosram marked this pull request as draft May 23, 2020 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant