 DROP FUNCTION IF EXISTS col_has_default //
 CREATE FUNCTION col_has_default(sname VARCHAR(64), tname VARCHAR(64), cname VARCHAR(64), description TEXT)
 RETURNS TEXT
+DETERMINISTIC
+CONTAINS SQL
 BEGIN
   IF description = '' THEN
     SET description = CONCAT('Column ',

DROP FUNCTION IF EXISTS col_has_named_index //
CREATE FUNCTION col_has_named_index(sname VARCHAR(64), tname VARCHAR(64), cname VARCHAR(64), kname VARCHAR(64), description TEXT)
RETURNS TEXT
BEGIN
  SET kname := COALESCE(kname, cname); -- use the column name as index name if nothing is given


DROP FUNCTION IF EXISTS col_hasnt_default //
CREATE FUNCTION col_hasnt_default(sname VARCHAR(64), tname VARCHAR(64), cname VARCHAR(64), description TEXT)
RETURNS TEXT
DETERMINISTIC
CONTAINS SQL
BEGIN
  IF description = '' THEN
   SET description = CONCAT('Column ',
