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

fix: write sql migration files for wrappers #1114

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

samrose
Copy link
Contributor

@samrose samrose commented Aug 12, 2024

What kind of change does this PR introduce?

we need to produce a series of migration files on pkg build, although they are all a copy of the latest

The goal is to emulate what happened in the release gh action for https://github.com/supabase/wrappers

We need to fetch the release tags from github (in this case in a preBuild phase before we start building) write to file, and use the file to copy the latest wrappers--$current_version.sql to a wrappers--$prev_version-$current_version.sql and writing that into the nix store.

The outcome should be that all of those identical files end up at

/nix/store/postressqlbundle-hash/share/postgresql/extension/

rwxrwxrwx  4 root root   100 Dec 31  1969 vector.control -> /nix/store/3zk1d03nrg9d01hpb7x5jdcs3w5d15yg-pgvector-0.7.4/share/postgresql/extension/vector.control
lrwxrwxrwx  4 root root    96 Dec 31  1969 vector.sql -> /nix/store/3zk1d03nrg9d01hpb7x5jdcs3w5d15yg-pgvector-0.7.4/share/postgresql/extension/vector.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.0--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.0--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.10--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.10--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.1--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.1--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.11--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.11--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.12--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.12--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.14--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.14--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.15--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.15--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.16--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.16--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.17--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.17--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.18--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.18--0.4.1.sql
lrwxrwxrwx  4 root root   122 Dec 31  1969 wrappers--0.1.19--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.19--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.4--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.4--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.5--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.5--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.6--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.6--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.7--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.7--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.8--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.8--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.1.9--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.1.9--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.2.0--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.2.0--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.3.0--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.3.0--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.3.1--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.3.1--0.4.1.sql
lrwxrwxrwx  4 root root   121 Dec 31  1969 wrappers--0.4.0--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.4.0--0.4.1.sql
lrwxrwxrwx  4 root root   114 Dec 31  1969 wrappers--0.4.1.sql -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers--0.4.1.sql
lrwxrwxrwx  4 root root   111 Dec 31  1969 wrappers.control -> /nix/store/px3wvdr1wjy642spm653x713zfydmqyn-supabase-wrappers-0.4.1/share/postgresql/extension/wrappers.control

for example. This PR has tested and verified this is working

@samrose samrose requested a review from a team as a code owner August 12, 2024 18:58
@darora darora merged commit fe0e511 into release/15.6-lw12 Aug 12, 2024
11 checks passed
@darora darora deleted the sam/wrappers-sql-fix branch August 12, 2024 23:39
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.

3 participants