Migrations failing to run
See original GitHub issueBug report
Describe the bug
Migrations are failing to run when starting the storage server
A clear and concise description of what the bug is.
supa-storage@0.0.1 restart:db docker-compose --project-dir . -f src/test/db/docker-compose.yml down && docker-compose --project-dir . -f src/test/db/docker-compose.yml up -d && sleep 5 && npm run migration:run
Stopping storage-api_rest_1 … done Stopping storage-api_db_1 … done Removing storage-api_rest_1 … done Removing storage-api_db_1 … done Removing network storage-api_default Creating network “storage-api_default” with the default driver Creating storage-api_db_1 … done Creating storage-api_rest_1 … done
supa-storage@0.0.1 migration:run ts-node-dev ./src/scripts/migrate-call.ts
[INFO] 17:56:58 ts-node-dev ver. 1.1.6 (using ts-node ver. 9.1.1, typescript ver. 4.2.3)
running migrations
(node:2616) UnhandledPromiseRejectionWarning: Error: Migration failed. Reason: An error occurred running ‘create-migrations-table’. Rolled back this migration. No further migrations were run. Reason: no schema
has been selected to create in
at D:\PROJECTS\storage-api\node_modules\postgres-migrations\dist\migrate.js:63:27
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at D:\PROJECTS\storage-api\node_modules\postgres-migrations\dist\with-lock.js:25:28
(Use node --trace-warnings ...
to show where the warning was created)
(node:2616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not han
dled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection
id: 1)
(node:2616) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- clone supabase/storage-api
- cd storage-api
- npm run restart:db 4 migrations failing to run
Expected behavior
A clear and concise description of what you expected to happen.
Server should run
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. chrome, safari]
- Version of supabase-js: [e.g. 6.0.2]
- Version of Node.js: [e.g. 10.10.0]
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Hi @difelice, can you check if postgrest has storage in
PGRST_DB_SCHEMA
like hereThanks, that was the issue