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

Fixing schema data types and database types #84

Merged
merged 4 commits into from
Mar 20, 2015
Merged

Conversation

subnetmarco
Copy link
Member

Addressing this issue: bb12c81#commitcomment-10298943

I am not happy because it introduces one more property in the schemas. In the early days we tried to fix this with convention but it didn't work out well because of edge-cases, but maybe we can stil try going through that path.

To recap before we tried to fix this problem with convention and we tried to get everything that ended with *id and treat it as an UUID. This didn't always work well because some properties, like accounts.provider_id, are not UUIDs but custom strings.

So we decided to make id and timestamp data types, but they really are string and number. We have three options here:

  • Fixing the convention problem, but it's not going to be scalable in the future
  • Extending the types and make the implicit assumption that id is always going to be string and timestamp is always going to be a number.
  • Introducing represents or something like that.

@subnetmarco subnetmarco changed the title Introducing "represents" to fix the schema types problem Fixing schema data types and database types Mar 20, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+0.17%) to 72.48% when pulling 20deb99 on fix/schemas into d5ce9dd on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.17%) to 72.48% when pulling 20deb99 on fix/schemas into d5ce9dd on master.

@subnetmarco
Copy link
Member Author

I decided to remove represents and make the database types actual data types.

In the schema validation id is an alias for string, and timestamp is an alias for number.

@subnetmarco
Copy link
Member Author

This pull request also fixes #81

subnetmarco added a commit that referenced this pull request Mar 20, 2015
Fixing schema data types and database types
@subnetmarco subnetmarco merged commit 9410f3c into master Mar 20, 2015
@subnetmarco subnetmarco deleted the fix/schemas branch March 20, 2015 04:11
@coveralls
Copy link

Coverage Status

Coverage increased (+0.22%) to 72.53% when pulling 11e97ac on fix/schemas into d5ce9dd on master.

ctranxuan pushed a commit to streamdataio/kong that referenced this pull request Aug 25, 2015
Fixing schema data types and database types
gszr pushed a commit that referenced this pull request Oct 26, 2021
gszr pushed a commit that referenced this pull request Oct 27, 2021
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.

2 participants