Skip to content

Commit

Permalink
Merge pull request #205 from hypercerts-org/fix/generated_types
Browse files Browse the repository at this point in the history
chore(update): supabase npm package
  • Loading branch information
bitbeckers authored Aug 30, 2024
2 parents add125b + ea33a51 commit df97d1c
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/supabase-ci-production.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: roll out supabase migration
name: roll out supabase migration to production
on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/supabase-ci-staging.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: roll out supabase migration
name: roll out supabase migration to staging
on:
push:
branches:
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/supabase-ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: verify supabase types
on:
pull_request:

env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
# Retrieve <project-id> from dashboard url: https://app.supabase.com/project/<project-id>
PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: supabase/setup-cli@v1
with:
version: latest

- name: Start Supabase local development setup
run: supabase start

- name: Verify generated types are checked in
run: |
supabase gen types typescript --local > src/types/database-generated.types.ts
if ! git diff --ignore-space-at-eol --exit-code --quiet ./src/types/database-generated.types.ts; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"prool": "^0.0.15",
"rimraf": "^5.0.5",
"sinon": "^17.0.1",
"supabase": "^1.187.3",
"supabase": "^1.191.3",
"supertest": "^6.3.4",
"ts-mockito": "^2.6.1",
"tsx": "^4.7.1",
Expand Down
30 changes: 15 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions supabase/migrations/20240830131559_enable_realtime_tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- remove the supabase_realtime publication
drop
publication if exists supabase_realtime;

-- re-create the supabase_realtime publication with no tables
create publication supabase_realtime;

-- add a table called 'messages' to the publication
-- (update this to match your tables)
alter
publication supabase_realtime add table allow_list_data;
alter
publication supabase_realtime add table attestations;
alter
publication supabase_realtime add table claims;
alter
publication supabase_realtime add table fractions;
alter
publication supabase_realtime add table hypercert_allow_list_records;
alter
publication supabase_realtime add table hypercert_allow_lists;
alter
publication supabase_realtime add table metadata;
alter
publication supabase_realtime add table sales;

0 comments on commit df97d1c

Please sign in to comment.