At first, thank you for such a great job! It's feel so good to use async ORM with familiar django-style. I'm planning to use tortoise in my new projects.
Describe the bug
I'm not able to apply migration, describing user model creation. Aerich tries to create "user" table, if it's not exists, but Postgres has built-in pseudo-function, named "user'.
Can't apply aerich migration created for user model in postgres, because of tortoise default table name
To Reproduce
Create model named User
Generate migration for it, using aerich
Get SQL-migration, that looks like following:
CREATE TABLE IF NOT EXISTS \"user\" (\n \"id\" SERIAL NOT NULL PRIMARY KEY,\n \"first_name\" VARCHAR(100) NOT NULL,\n \"last_name\" VARCHAR(100) NOT NULL\n);
Try to apply it
It won't be applied, because Postgres has builtin user model
Expected behavior
Migration applies
Additional context
I think, tortoise orm should add prefixes to default table name. E.g. django-style like _ or even tortoise_
Otherwise i have to override Meta.table in all my tortoise orm by myself.
At first, thank you for such a great job! It's feel so good to use async ORM with familiar django-style. I'm planning to use tortoise in my new projects.
Describe the bug I'm not able to apply migration, describing user model creation. Aerich tries to create "user" table, if it's not exists, but Postgres has built-in pseudo-function, named "user'.
Can't apply aerich migration created for user model in postgres, because of tortoise default table name
To Reproduce
aerich
CREATE TABLE IF NOT EXISTS \"user\" (\n \"id\" SERIAL NOT NULL PRIMARY KEY,\n \"first_name\" VARCHAR(100) NOT NULL,\n \"last_name\" VARCHAR(100) NOT NULL\n);
Expected behavior
Additional context I think, tortoise orm should add prefixes to default table name. E.g. django-style like_ or even tortoise_
Otherwise i have to override
Meta.table
in all my tortoise orm by myself.