Is it possible to define (alias) a base data type in MySQL?
Currently I would like to define UUID as char(32), and then use UUID as the type throughout the schema de
In this case a text preprocesor like M4 or any C-language preprocesor may be useful.
If you have the following in file tables.sql:
define(UUID, char(32))
create table mytable1 (my_uuid UUID);
create table mytable2 (my_uuid UUID);
Running
$ m4 tables.sql
you'll get:
create table mytable1 (my_uuid char(32));
create table mytable2 (my_uuid char(32));
well ENUM does the work until certain expectation of your custom data types, but i'm too hoping to look forward to this topic