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

Store Datatypes in database #80

Merged
merged 5 commits into from
Apr 22, 2024
Merged

Conversation

alexbainter
Copy link
Collaborator

@alexbainter alexbainter commented Apr 17, 2024

Closes #77.

  • Adds a table for datatypes and their help text
  • Updates the article population process to also populate the datatype table
  • Updates the index view to pull datatype help text from the database instead of GitHub

Follow-up steps (future PRs):


def create_datatype(name):
def create_datatype(datatype_object):
name = datatype_object.name
return {
'id': '_'.join(name.split()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can follow up with a PR to start using actual IDs here; there's some JS that will need to be updated too

Copy link
Collaborator

@aaronjae22 aaronjae22 left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼

@@ -88,3 +88,7 @@ class QueryLog(BaseModel):
datatype = models.CharField(max_length=30)
source = models.TextField(max_length=100)
destination = models.TextField(max_length=100)

class DataType(BaseModel):
name = models.CharField(max_length=30)
Copy link
Member

Choose a reason for hiding this comment

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

It seems fine for the moment for the articles table NOT to have a foreign key to this one. WE can always change that in a migration later if we want the tables to link to each other and ensure integrity of the data type names. So I agree with this approach at least util we find need to enforce the dependency or follow the foreignkey relationship.

@alexbainter alexbainter merged commit e2f05e3 into main Apr 22, 2024
4 checks passed
@alexbainter alexbainter deleted the alex-77-datatype-population branch April 22, 2024 16:28
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.

Copy datatypes-help to the portmap DB when we populate articles so it's in synch
3 participants