-
-
Notifications
You must be signed in to change notification settings - Fork 22
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 support for default_version
in control file
#153
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because old dbdev CLI versions are not aware of default_version, the default_version_struct and default_version columns in app.packages are nullable for backward compatibility with those older CLI versions.
The current user base is like 5 people and we're pre-1.0. I think it's worth taking a breaking change thats solvable with a CLI upgrade to avoid having to make the field nullable at this point. wdyt?
|
-- default_version column has a default value '0.0.0' only temporarily because the column is not null. | ||
-- It will be removed below. | ||
alter table app.packages | ||
add column default_version_struct app.semver not null default app.text_to_semver('0.0.0'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_version_struct
is not longer nullable.
if default_version is null then | ||
raise exception 'default_version is required. If you are on `dbdev` CLI version 0.1.5 or older upgrade to the latest version.'; | ||
end if; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the client doesn't send default_version
we hint in the error message for older clients to be upgraded to the latest.
What kind of change does this PR introduce?
feature
What is the current behavior?
default_version
key in the control file is not sent to the backend when a user runsdbdev publish
. This results in TLE's default version being the first installed version which is usually the oldest version.What is the new behavior?
The
default_version
is now tracked in theapp.packages
table in thedefault_version_struct
anddefault_version
columns. Thedbdev
CLI also sends thedefault_version
from the control file to the backend when runningdbdev publish
command. The CLI also checks that thedefault_version
in the control file is one of the valid versions of the package. The in-db client has been updated to fetch thedefault_version
from thepublic.packages
view and call thepgtle.set_default_version
function.Because old dbdev CLI versions are not aware of
default_version
, thedefault_version_struct
anddefault_version
columns inapp.packages
are nullable for backward compatibility with those older CLI versions.Additional context
Fixes #147