let regular_type_of_old_sql_type t =
  let module T = SQL_db in
  let (s1,arg,_) = t in
  try
    let ty =
      match String.lowercase s1, arg with
        "tinyint", _ -> T.TinyInt (None,T.NO_None)
      | "mediumint", _ -> T.MediumInt (None,T.NO_None)
      | "int", _ -> T.Int (None,T.NO_None)
      | "bigint", _ -> T.BigInt (NoneT.NO_None)
      | "double", _ -> T.Double (NoneT.NO_None)
      | "float", _ -> T.Float (NoneT.NO_None)
      | "decimal", _ -> T.Decimal (None,T.NO_None)
      | "char"None -> T.Char 1
      | "char"Some s
      | "char(m)"Some s -> T.Char (int_of_string s)
      | "varchar"Some s
      | "varchar(m)"Some s -> T.VarChar (int_of_string s)
      | "tinyblob", _ -> T.TinyBlob
      | "blob", _ -> T.Blob
      | "mediumblob", _ -> T.MediumBlob
      | "longblob", _ -> T.LongBlob
      | "tinytext", _ -> T.TinyText
      | "text", _ -> T.Text
      | "mediumtext", _ -> T.MediumText
      | "longtext", _ -> T.LongText
      | _, _ ->raise Not_found
    in
    Some ty
  with
    Not_found -> None