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

Add db creation script #84

Merged
merged 9 commits into from
Oct 15, 2019
Merged

Add db creation script #84

merged 9 commits into from
Oct 15, 2019

Conversation

keiranjprice101
Copy link
Collaborator

closes #70

@keiranjprice101 keiranjprice101 changed the title 70 add db creation script Add db creation script Oct 14, 2019
Copy link
Member

@louise-davies louise-davies left a comment

Choose a reason for hiding this comment

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

I can't run the script:

Traceback (most recent call last):
  File "util/icat_db_generator.py", line 9, in <module>
    from common.models import db_models
ModuleNotFoundError: No module named 'common'

I've tried running it in utils as well as running it in common

@keiranjprice101
Copy link
Collaborator Author

I had this issue only when I ran it through git bash. It ran fine with powershell. Is it possible this is similar to the issue you have with the tests @louise-davies

@louise-davies
Copy link
Member

This is on the preprod machine, so it is using bash but native bash. The preprod machine can run the test command fine.

@keiranjprice101
Copy link
Collaborator Author

Ok. I'll take a look

@keiranjprice101
Copy link
Collaborator Author

@louise-davies I have updated the instructions. It turns out that you need to use python -m util.icat_db_generator This was also the problem I had initially with the instructions for running the api without flask run months ago. e.g. python -m src.main

session.close()


def get_time_now():
Copy link
Member

Choose a reason for hiding this comment

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

Maybe rename this function if it no longer gets the current time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed and changed the range of dates from 2000-2019 to give a nicer range that matches more closely the other possible dates for other fields.

@keiranjprice101 keiranjprice101 merged commit c74c0cf into master Oct 15, 2019
@keiranjprice101 keiranjprice101 deleted the 70_add_db_creation_script branch October 15, 2019 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DB creation script
2 participants