#๐Ÿ”’ alembic revision --autogenerate is backwards

12 messages ยท Page 1 of 1 (latest)

balmy phoenixBOT
#

@autumn gale

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

autumn gale
#

I'm using postgresql+asyncpg as my driver, with sqlmodel handling models. my migration files are autogenerated backwards, with my upgrades in downgrades and my downgrades in upgrades

void kraken
#

@autumn gale your deleted message

I've uploaded my env.py and scripy.mako below.  What is generated is correct code, excpet for one issue. 

the upgrades are in downgrades() and the downgrades are un upgrades(). I'm using sqlmodel if that matters with the asyncpg on postgres
autumn gale
hard karma
#

I'm tempted to think that you just didn't run the migrations (or your alembic table is just out of sync or something)

autumn gale
#

It could be that, but at the same time it's been consistently happening. Like it's never not happened

#

Maybe sqlmodel/sqalchemy detected the new table in this case and created it, but it doesn't explain why the table (users) is altered backward too

balmy phoenixBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.