﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29494	Flush command doesn’t work on custom db_table including schema	Bertrand Bordage	nobody	"Suppose you have a model like this on PostgreSQL:
{{{
class SomeModel(Model):
    class Meta:
        db_table = '""public"".""someapp_somemodel""'
}}}
Flushing has no impact on this model, which is very important in tests, since data created in `setUp` is normally automatically removed in `tearDown` using the `flush` command.

This is because `connection.introspection.django_table_names` is used with the argument `only_existing=True`, which removes every name that is not exactly yield by `connection.introspection.get_table_list`. In my example, `only_existing=True` removes `'""public"".""someapp_somemodel""'` because it is not exactly the same as `'someapp_somemodel'`.

A solution could be to add a method that would yield full table names, and use that method in the flush command.

Another solution can be to ammend django_table_names and manually check against a regexp and a list of existing schemas+tables combinations…"	Bug	closed	Database layer (models, ORM)	dev	Normal	duplicate		Carlton Gibson	Unreviewed	0	0	0	0	0	0
