-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: keep studyu-schema.sql updated by gh action
- Loading branch information
1 parent
780d6de
commit 5e4dfb9
Showing
16 changed files
with
1,753 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Dumps database schema | ||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/dump-database.yml" | ||
- "database/**" | ||
- "supabase/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pgtap: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: supabase/postgres | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare Supabase CI Seed | ||
run: | | ||
cp supabase/seed-ci.sql supabase/seed.sql | ||
- name: Set up Supabase CLI | ||
uses: supabase/setup-cli@v1 | ||
with: | ||
version: latest | ||
|
||
- name: Start Supabase database | ||
run: | | ||
supabase db start | ||
- name: Export public database schema into database/studyu-schema.sql | ||
run: | | ||
supabase db dump --local --keep-comments --schema public --file database/studyu-schema.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Database | ||
|
||
This directory contains the StudyU database schema and migration scripts. | ||
|
||
Do not make any changes to the `studyu-schema.sql` file directly. Instead, create a new migration | ||
script in the `migrations` directory. The schema file will be updated automatically by the CI/CD pipeline. | ||
|
||
## Migrations | ||
|
||
Any new database schema changes should be added as a new migration script in the `migrations` directory. | ||
The migration script should be named `{timestamp}__{description}.sql`, where `{timestamp}` is the current | ||
timestamp and `{description}` is a short description of the migration. |
Oops, something went wrong.