Open estani opened 4 years ago
Had the same issue, looked into it and it functions as expected: config.persistent_schemas
values are added to the search_path
, so the path looks like search_path = <new-tenant>,mng
.
During tenant creation, a DROP TABLE ...
command is issued after the new schema was created and before the tables are created in the new schema. Since the table to drop is not yet in the new schema, the next schema is checked for a table with this name and voila, it drops the tables with the same name in mng
That's really bad. How did you get around it deleting your database?
We switched to using config.use_sql = true
which uses a different approach on creating the schema and doesn't have the drop table issue.
I had this config line:
My expectation was that the
mng
schema will be added to the search path and nothing more.What happens ist that just that line caused that when a new tenant schema is created, the tables in
mng
get wiped. (I think I saw them in the user schema, but I might be wrong).I've remove it and now everything works as expected. Am I misunderstanding the docs?