Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5391 closed defect (fixed)

Migration issue with postgres on new setups

Reported by: Jessica Tallon Owned by:
Priority: blocker Milestone: 0.9.0
Component: programming Keywords: db, migrations, alembic
Cc: Parent Tickets:


When you setup Mediagoblin for the first time and use postgres for some reason you get an exception claiming the Graveyard table doesn't exist. I suspect it's somehow related to the switch to alembic however i'm unsure.

Steps to reproduce:

  1. Follow basic instructions: ./bootstrap && ./configure && make
  2. Setup a brand new postgres database (configure to use it in mediagoblin.ini)
  3. Run the ./bin/gmg dbupdate

Change History (3)

comment:1 by Jessica Tallon, 8 years ago

Okay. I think I've found the issue. I've had a look and it seems all the Alembic migrations get a connection to the sqlite database (which might or might not exist) regardless of what's set in mediagoblin.ini.

I tracked it down and it's just because the sqlite database is statically defined here:

I'm not sure why it sometimes works when configured to use PostgreSQL but it shouldn't, ever. For it to work, doesn't make sense at all. I'm going to try and create a fix where this option is removed and populated in code in the migration manager from the mediagoblin config.

comment:2 by Jessica Tallon, 8 years ago

Resolution: fixed
Status: newclosed

I've fixed this issue. My fix whilst it works just fine, I've filed an issue to make the code a bit more obvious for future devs looking at it (see #5395). The fix is now in master as of 2ddebb9.

comment:3 by Christopher Allan Webber, 8 years ago


All 0.8.2 tickets are being rolled over to 0.9.0

Note: See TracTickets for help on using tickets.