Migration is not applied with new auth module #4531
Replies: 2 comments
-
|
I've had to reset the postgres volume and manually apply the migration.sql using one thing I noticed is in I think this might be the problem? |
Beta Was this translation helpful? Give feedback.
-
|
Hi @rezmeplxrf ^IMO, I can see what's happening here. Your migrations are being created correctly, but there's a timing issue in your startup sequence that's preventing them from being applied, the error occurs because you're accessing the database during server initialization, before the --apply-migrations flag has a chance to execute. using Note: The fact that you had to manually run the migration via psql confirms the migrations themselves are valid - it's purely a timing issue in your initialization code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The sequence of commands I ran:
serverpod generate && serverpod create-migration --force
dart bin/main.dart --apply-migrations
Error after running
dart bin/main.dart --apply-migrations(Also, tried
dart run bin/main.dart --apply-repair-migrationand got the same result)My pubspec.yaml:
name: kindling_food_server
description: Starting point for a Serverpod server.
version: 1.0.0
homepage: https://www.example.com
environment:
sdk: '^3.8.0'
dependencies:
serverpod: 3.1.1
serverpod_auth_idp_server: 3.1.1
dev_dependencies:
lints: '>=3.0.0 <7.0.0'
serverpod_test: 3.1.1
test: ^1.25.5
very_good_analysis: ^10.0.0
serverpod:
scripts:
repair: serverpod generate && serverpod create-repair-migration
migration: serverpod generate && serverpod create-migration --force
start: dart bin/main.dart --apply-migrations
maintenance: dart bin/main.dart --apply-migrations --role maintenance
test: dart test
flutter_build: cd ../kindling_food_flutter && flutter build web --base-href /app/ --wasm && rm -rf ../kindling_food_server/web/app && mv build/web/ ../kindling_food_server/web/app
My migration_registry.txt
CREATE TABLE "serverpod_auth_idp_email_account" clearly exists in both definition.sql and migration.sql
Beta Was this translation helpful? Give feedback.
All reactions