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

Create tables and initialize with dummy data if required #158

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MaxWies
Copy link
Contributor

@MaxWies MaxWies commented May 16, 2020

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
"PIRAT_WEBAPP_ENVIRONMENT",

"PIRAT_INIT_DB_TABLES_IF_NOT_EXIST",
"PIRAT_INIT_DUMMY_DATA_IF_NOT_EXIST"
Copy link
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
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...

Pirat/Program.cs Outdated Show resolved Hide resolved
@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