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

feat: Add v1 schema types #17

Merged
merged 2 commits into from
Jan 12, 2022
Merged

feat: Add v1 schema types #17

merged 2 commits into from
Jan 12, 2022

Conversation

kylecarbs
Copy link
Member

@kylecarbs kylecarbs commented Jan 12, 2022

This adds compatibility for sharing data with Coder v1. Since the tables are the same, all CRUD operations should function as expected.

What if v1 changes a type?

We'll need to reflect the updated type with an optional migration in v2.

What happens when we want to refactor users in v2, but still need to support v1?

It's much easier to fork the logic once we have data, so these tables will match the schema of v1 while it exists.

This adds compatibility for sharing data with Coder v1. Since the tables are the same, all CRUD operations should function as expected.
@kylecarbs kylecarbs self-assigned this Jan 12, 2022
@codecov
Copy link

codecov bot commented Jan 12, 2022

Codecov Report

Merging #17 (3b1d1da) into main (ec3685b) will decrease coverage by 1.67%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
- Coverage   71.58%   69.91%   -1.68%     
==========================================
  Files          17       18       +1     
  Lines        1112     1130      +18     
==========================================
- Hits          796      790       -6     
- Misses        246      269      +23     
- Partials       70       71       +1     
Flag Coverage Δ
macos-latest 60.79% <0.00%> (-2.38%) ⬇️
ubuntu-latest 69.91% <0.00%> (+0.48%) ⬆️
windows-latest 60.99% <0.00%> (-1.77%) ⬇️
Impacted Files Coverage Δ
database/models.go 0.00% <0.00%> (ø)
peer/conn.go 72.41% <0.00%> (-1.89%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec3685b...3b1d1da. Read the comment docs.

Copy link
Contributor

@bryphe-coder bryphe-coder left a comment

Choose a reason for hiding this comment

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

Looks good to me! Sharing the v1 tables seems like a reasonable approach. Thanks for addressing the questions of handling v1 changes to the tables, or v2 augmentations to the data 👍

@kylecarbs kylecarbs merged commit 0778f3e into main Jan 12, 2022
@kylecarbs kylecarbs deleted the v1schema branch January 12, 2022 18:04
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.

None yet

2 participants