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
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,17 @@ All CLI commands below should be run in this directory (`packages/database`.)
15
15
1. Assuming you're working on a feature branch.
16
16
2. Make changes to the schema, by editing files in `packages/database/supabase/schemas`
17
17
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.
18
-
4.`turbo build`, which will do the following:
19
-
1. Check your logic with `sqruff lint supabase/schemas`, and eventually `sqruff fix supabase/schemas`
20
-
2. Regenerate the types file with `supabase gen types typescript --local > types.gen.ts`
18
+
4.`turbo check-types`, which will do the following:
19
+
1. Check your logic with `sqruff lint supabase/schemas`
20
+
1. If there are errors there, you can fix them with `npm run lint:fix`
21
+
2. Stop supabase.
21
22
3. See if there would be a migration to apply with `supabase db diff`
22
23
5. If applying the new schema fails, repeat step 4
23
24
6. If you are satisfied with the migration, create a migration file with `npm run dbdiff:save some_meaningful_migration_name`
24
25
1. If all goes well, there should be a new file named `supbase/migration/2..._some_meaningful_migration_name.sql` which you should `git add`.
25
-
10. You can start using your changes again `turbo dev`
26
+
7.`turbo build`, which will do the following:
27
+
1. Start supbase
28
+
2. Apply the new migration locally
29
+
3. Regenerate the types file with `supabase gen types typescript --local > types.gen.ts`
30
+
4. Copy it where appropriate
31
+
8. You can start using your changes again `turbo dev`
0 commit comments