On the init aerich trying to get aerich table and creates errors in the db log:
2021-03-29 20:29:26.345 UTC [153] ERROR: relation "aerich" does not exist at character 15
2021-03-29 20:29:26.345 UTC [153] STATEMENT: SELECT 1 FROM "aerich" WHERE "version"='0_20210325003854_init.sql' AND "app"='models' LIMIT 1
2021-03-29 21:00:02.812 UTC [229] ERROR: relation "aerich" does not exist at character 44
2021-03-29 21:00:02.812 UTC [229] STATEMENT: SELECT "id","content","app","version" FROM "aerich" WHERE "app"='models' ORDER BY "id" DESC LIMIT 1
Solution
You should avoid creating errors by checking table aerich exists first.
For example:
SELECT EXISTS (
SELECT FROM pg_tables
WHERE schemaname = 'schema_name'
AND tablename = 'table_name'
);
Problem
On the init aerich trying to get
aerich
table and creates errors in the db log:Solution
You should avoid creating errors by checking table
aerich
exists first.For example:
More info:
https://stackoverflow.com/questions/20582500/how-to-check-if-a-table-exists-in-a-given-schema