Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite support? #40

Closed
mjhea0 opened this issue Sep 10, 2020 · 3 comments
Closed

sqlite support? #40

mjhea0 opened this issue Sep 10, 2020 · 3 comments

Comments

@mjhea0
Copy link

mjhea0 commented Sep 10, 2020

SQLite doesn't support DROP COLUMN columns:

{
  "upgrade": [
    "ALTER TABLE \"foo\" ADD \"bar\" TEXT NOT NULL",
    "ALTER TABLE \"foo\" DROP COLUMN \"foo\""
  ],
  "downgrade": [
    "ALTER TABLE \"foo\" ADD \"foo\" TEXT NOT NULL",
    "ALTER TABLE \"foo\" DROP COLUMN \"bar\""
  ]
}
@long2ice
Copy link
Member

I rarely used sqlite and know little about it's syntax, and wan't Intend to support it.

@mjhea0
Copy link
Author

mjhea0 commented Sep 20, 2020

That's fine. Since Tortoise does support it, you may want to indicate on the README that SQLite isn't officially supported by Aerich to avoid confusion.

On another note, I tossed together a quick sample project for FastAPI + Tortoise + Aerich if you want to reference it: https://github.com/testdrivenio/fastapi-tortoise-aerich.

@pmdevita
Copy link

pmdevita commented Jul 2, 2021

As of 3.35.0 https://sqlite.org/releaselog/3_35_0.html SQLite now supports DROP COLUMN. I did a very basic test where I commented out def drop_column in aerich/ddl/sqlite. This generated migrations with the command and I can confirm upgrade and downgrade work as expected.

long2ice added a commit that referenced this issue Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants