Postgresqlテーブルスキーマが与えられた場合:
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);
私が理解していない2つの行があり、それらをMySqlテーブルスキーマに変換することさえ可能かどうか疑問に思っていますか?次の行は、それ自体を参照しているように見えるため、MySqlが理解できるものに変換できますか?
type int references thing,
さらに、最後の行に相当するMySqlはありますか?
$for name in ['key', 'type', 'latest_revision', 'last_modified', 'created']:
create index thing_${name}_idx ON thing($name);