Given a Postgresql table schema:
create table thing (
    id serial primary key,
    key text,
    type int references thing,   
    latest_revision int default 1,
    created timestamp default(current_timestamp at time zone 'utc'),
    last_modified timestamp default(current_timestamp at time zone 'utc')
);
$for name in ['key', 'type', 'latest_revision', 'last_modified', 'created']:
    create index thing_${name}_idx ON thing($name);
There are two lines i do not understand and am wondering if it is even possible to convert them to a MySql table schema? Can the following line be converted to something MySql would understand, as it seems to be referencing itself:
type int references thing,
Plus, is there a MySql equivalent for the last line:
$for name in ['key', 'type', 'latest_revision', 'last_modified', 'created']:
    create index thing_${name}_idx ON thing($name);