You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/database/README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,14 +36,16 @@ We follow the Supabase [Declarative Database Schema](https://supabase.com/docs/g
36
36
1. Assuming you're working on a feature branch.
37
37
2. Make changes to the schema, by editing files in `packages/database/supabase/schemas`
38
38
3. If you created a new schema file, make sure to add it to `[db.migrations] schema_paths` in `packages/database/supabase/config.toml`. Schema files are applied in that order, you may need to be strategic in placing your file.
39
-
4.`turbo check-schema`, which will do the following:
39
+
4.`pnpm run check-schema`, which will do the following:
40
40
1. Check your logic with `sqruff lint supabase/schemas`
41
41
1. If there are errors there, you can fix them with `pnpm run lint:fix`
42
42
2. Stop Supabase.
43
-
3. See if there would be a migration to apply with `supabase db diff`
43
+
3. See if there would be a migration to apply with `pnpm run dbdiff`
44
+
4. Also check with `pnpm run dbdiff:legacy`, which has known false positives (esp. views), but is more complete (esp. with respect to grants).
44
45
5. If applying the new schema fails, repeat step 4
45
46
6. If you are satisfied with the migration, create a migration file with `pnpm run dbdiff:save some_meaningful_migration_name`
46
47
1. If all goes well, there should be a new file named `supabase/migrations/2..._some_meaningful_migration_name.sql` which you should `git add`.
48
+
2. If there were _valid_ migration steps identified by `dbdiff:legacy` that were missing in `dbdiff` you may have to add them by hand to that file.
47
49
7.`pnpm run migrate`, which will do the following:
0 commit comments