﻿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
31383	Make createcachetable use SchemaEditor for SQL generation	Tim Graham	Stephen kihuni	"The createcachetable management command [https://github.com/django/django/blob/c1c361677d9400c8e2cdaddda0c16086bb358492/django/core/management/commands/createcachetable.py#L65-L87 generates its SQL manually]. The generated SQL:
{{{ #!sql
CREATE TABLE test_cache_table (
    cache_key STRING(255) NOT NULL PRIMARY KEY,
    value STRING(MAX) NOT NULL,
    expires TIMESTAMP NOT NULL
)
}}}
is incompatible with Google's Cloud Spanner databases, which requires a different PRIMARY KEY syntax:
{{{ #!sql
CREATE TABLE test_cache_table (
    cache_key STRING(255) NOT NULL,
    value STRING(MAX) NOT NULL,
    expires TIMESTAMP NOT NULL
) PRIMARY KEY (cache_key)
}}}
This issue wouldn't happen if the management command used `SchemaEditor.create_model()` for SQL generation."	Cleanup/optimization	assigned	Core (Management commands)	dev	Normal			Ülgen Sarıkavak	Accepted	1	0	0	1	0	0
