﻿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
15643	Custom SQL can not be executed in any way	Vlastimil Zíma	nobody	"According to documentation it should be possible to use custom SQL for databases. But there is no way how we can ""create SQL functions, views, triggers, etc."" as documentation says.

When you try to use initial SQL it parses and messes what is in file unless it is some basic statement like INSERT. You can not really add trigger, because django messes your SQL by running what is between semicolons separately.

When you try to use post_syncdb signal to run your custom SQL then you can not use flush command, because it fails on database errors that your triggers/functions/constraints/... already exists and it is not possible to write IF NOT EXISTS everywhere.


Best solution for all is to remove the parser for custom SQL, it can not prevent errors anyway, we can still insert wrong values. Just let us upload our SQLs without messing them up and let us handle our SQL ourselves."		closed	Core (Management commands)	dev		duplicate			Unreviewed	0	0	0	0	0	0
