Skip to content
This repository was archived by the owner on Jun 13, 2020. It is now read-only.

Create tables and initialize with dummy data if required#158

Open
MaxWies wants to merge 3 commits into
developfrom
no_initialization_or_migration_of_database_schema_108
Open

Create tables and initialize with dummy data if required#158
MaxWies wants to merge 3 commits into
developfrom
no_initialization_or_migration_of_database_schema_108

Conversation

@MaxWies

@MaxWies MaxWies commented May 16, 2020

Copy link
Copy Markdown
Contributor

Use init.sql to load the commands to create tables and to define keys.

Use init_dummy_offers.json to load dummy data. init_dummy_offers.json contains so called OfferContext entries. An OfferContext has all entities that are used when an offer normally is made using the API. I will add some more examples if we agree on the way it is currently implemented.

Inserting other init_dummy_*.json to the db is not implemented (region_subscription, demands). This should be done in a further branch.

@MaxWies MaxWies requested a review from chaoran-chen May 16, 2020 08:35
Comment thread Pirat/Program.cs
"PIRAT_WEBAPP_ENVIRONMENT",

"PIRAT_INIT_DB_TABLES_IF_NOT_EXIST",
"PIRAT_INIT_DUMMY_DATA_IF_NOT_EXIST"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The variables should be optional with false being the default. Please also don't forget to edit the README.

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.

I do not see a disadvantage here to let them non optional. At least the developer or the server must initialize the fields with something. It's not much work...

Comment thread Pirat/Program.cs Outdated
@MaxWies MaxWies marked this pull request as ready for review May 29, 2020 13:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants