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

Initialise an existing project in a new environment #309

Open
ShipraShalini opened this issue Jun 30, 2023 · 3 comments
Open

Initialise an existing project in a new environment #309

ShipraShalini opened this issue Jun 30, 2023 · 3 comments

Comments

@ShipraShalini
Copy link

ShipraShalini commented Jun 30, 2023

I am trying to initialise aerich for an existing project which has configuration files and many migration files, in a new environment with a fresh db.

aerich init-db --safe true throws Inited models already, or delete migrations/models and try again. but the aerich table is not created.

aerich heads says No available heads, try migrate first

aerich upgrade says No upgrade items found

I don't want to run aerich migrate as the migration files are version controlled.

How can I achieve running all migrations (including the aerich table) in a new environment?

Similar to #267

@alexf-bond
Copy link

What about creating the aerich table manually via sql ddl and then runnning aerich upgrade?

@henryfool91
Copy link

+1, rn i'm keep clean db dump with aerich table only in my git repo as a workaround

@georges-g
Copy link

I had the same problem, trying to initialize a duplicate db with aerich init-db but it did not work:

Inited my_app already, or delete migrations/my_app and try again.

I just had to run aerich upgrade on the duplicate database instead, to create the tables, and it works well now. No need for manual creation in my case.

Make sure you have properly run aerich init and aerich init-db on the original database beforehand though.

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

4 participants