#๐ alembic revision --autogenerate is backwards
12 messages ยท Page 1 of 1 (latest)
@autumn gale
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.
https://paste.pythondiscord.com/UQ3Q -- migration generation files
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
@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
holy typos lol, maybe it shouldve stayed deleted. but thank you
Can you share an example migration file?
I'm tempted to think that you just didn't run the migrations (or your alembic table is just out of sync or something)
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
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.