@@ -139,7 +139,7 @@ test('Returns failure with migration-file-error (missing) when a migration direc
139139 / ^ M i g r a t i o n " 0 0 0 1 _ c r e a t e _ u s e r s " i s m i s s i n g i t s S Q L f i l e a t .+ 0 0 0 1 _ c r e a t e _ u s e r s [ / \\ ] m i g r a t i o n \. s q l \. $ / ,
140140 )
141141 expect ( issue . remediation ) . toMatch (
142- / ^ C r e a t e t h e f i l e a t .+ 0 0 0 1 _ c r e a t e _ u s e r s [ / \\ ] m i g r a t i o n \. s q l , o r r e m o v e t h e m i g r a t i o n ' s d i r e c t o r y i f i t i s n ' t i n t e n d e d \. $ / ,
142+ / ^ C r e a t e t h e f i l e a t .+ 0 0 0 1 _ c r e a t e _ u s e r s [ / \\ ] m i g r a t i o n \. s q l , o r r e m o v e t h e m i g r a t i o n ' s d i r e c t o r y i f i t i s n ' t i n t e n d e d \. O n l y r e m o v e t h e d i r e c t o r y i f t h e m i g r a t i o n h a s n o t y e t b e e n a p p l i e d t o a n y d a t a b a s e — i f i t w a s a p p l i e d , r e s t o r e t h e f i l e f r o m v e r s i o n c o n t r o l i n s t e a d \. $ / ,
143143 )
144144} )
145145
@@ -169,7 +169,11 @@ test('Returns failure with apply-failure issue when a migration has a syntax err
169169 'or in the cumulative database state left by previously applied migrations ' +
170170 '(for example, the migration tries to create an object that an earlier migration already created, ' +
171171 'or references one that was never created). Postgres returned SQLSTATE 42601; look that up for common causes. ' +
172- 'Resolve the issue in the failing migration or in the prior ones before deploying.' ,
172+ 'If the failing migration (or a prior one whose state is implicated) has not yet been applied to any database, ' +
173+ 'fix its SQL. If it has already been applied, you likely edited the file after the fact — applied migrations ' +
174+ 'are immutable, so restore it to its applied version (for example via version control or ' +
175+ '`netlify database migrations pull --force`). If neither situation matches, this may indicate a divergence ' +
176+ 'between Postgres and the embedded engine used for this check — please file a bug.' ,
173177 )
174178} )
175179
@@ -196,6 +200,10 @@ test('Returns failure with apply-failure issue when a migration creates a relati
196200 'or in the cumulative database state left by previously applied migrations ' +
197201 '(for example, the migration tries to create an object that an earlier migration already created, ' +
198202 'or references one that was never created). Postgres returned SQLSTATE 42P07; look that up for common causes. ' +
199- 'Resolve the issue in the failing migration or in the prior ones before deploying.' ,
203+ 'If the failing migration (or a prior one whose state is implicated) has not yet been applied to any database, ' +
204+ 'fix its SQL. If it has already been applied, you likely edited the file after the fact — applied migrations ' +
205+ 'are immutable, so restore it to its applied version (for example via version control or ' +
206+ '`netlify database migrations pull --force`). If neither situation matches, this may indicate a divergence ' +
207+ 'between Postgres and the embedded engine used for this check — please file a bug.' ,
200208 )
201209} )
0 commit comments