CREATE TABLE datatables_datatable
(
id serial NOT NULL,
title character varying(255) NOT NULL,
table_name character varying(255) NOT NULL,
tablespace character varying(255) NOT NULL,
uploaded_file character varying(100) NOT NULL,
create_table_sql text,
CONSTRAINT datatables_datatable_pkey PRIMARY KEY (id),
CONSTRAINT datatables_datatable_table_name_key UNIQUE (table_name)
)
WITH (
OIDS=FALSE
);
The datatable table has an index on table name:
Add code to handle name collissions