Question

App Platform build missing last db migration file.

I’ve done about 8 successful automatic GitHub builds. The first db migration (single table) was successful. Adding the second migration (new table) worked. However, my 3rd migration which was adding new columns to the first table was never ran. I checked in GH and the 3 migration files are there and the build reference the latest commit, but the build logs only show 2 migration files. I’ve tried doing a whole rebuild and still nothing. My DB only reflects the first 2 migration files.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
May 14, 2023
Accepted Answer

Hi there,

Does the migration work as expected locally on your development environment?

There are a few things that I could suggest checking:

  • Use the App Platform web console and check if the migration file is actually there, you can use the web console to browse through your project and see if the latest commit has actually been pulled. If the file is missing, I would recommend doing a ‘Force Rebuild and Deploy’ and possibly also checking if you have pushed the changes to the correct branch
  • If this is not the case, check all available logs, both from DigitalOcean App Platform and your application. There might be error messages or other information that can help diagnose the issue.
  • Check if the database state is consistent with the state expected by the migration. If the database is in an unexpected state, the migration might fail or be skipped.
  • If possible, try to run the migration manually to see if there’s an issue. This might provide more detailed error messages or other information that can help diagnose the issue.

Let me know how it goes!

Best,

Bobby

I ran into this error one more time today and the fix was the same. I don’t understand why it’s happening though or how I could fix it during deployment? What’s strange is that my app deploys “successfully” even though the db migration failed.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.