Skip to content

Commit 0d1c580

Browse files
Add instructions to apply migrations
1 parent 07fb90c commit 0d1c580

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,23 @@ Finished supabase secrets unset.
147147

148148
### Run Migrations
149149

150-
Todo write stuff
150+
💡You only need to run steps 1 since this sample includes migrations files ([here](https://github.com/OneSignalDevelopers/onesignal-supabase-sample-integration-supabase/tree/main/supabase/migrations)).
151+
152+
1. Run `supabase db diff` and copy its output
153+
[![Generate SQL script for Supabase migration](https://asciinema.org/a/541875.svg)](https://asciinema.org/a/541875)
154+
155+
2. Create a new migration and paste the output from the previous step into the `.sql` file
156+
[![Create Supabase Migration](https://asciinema.org/a/541879.svg)](https://asciinema.org/a/541879)
157+
158+
3. Run `supabase db push` to apply migrations to the hosted project
151159

152160
### Deploy Edge Function
153161

154162
We can deploy edge functions to a local or production environment. Developing locally allows us to test and iterate quickly.
155163

156164
#### Hosting locally
157165

158-
1. Start the Supabase Docker container, navigate to the root directory of this sample project and run `supabase start`.
166+
1. Start the Supabase Docker container, navigate to the root directory of this sample project and run `supabase start`
159167
2. To serve the function, run `supabase functions serve push --env-file ./supabase/.env.local --debug`
160168
3. Submit a request to the endpoint making sure to use the **anon key** as your bearer token.
161169

0 commit comments

Comments
 (0)