create unique index on the_table (least(from,to), greatest(from,to));
Akan mencegah penambahan (B,A,100) jika (A,B,100) sudah ada di tabel.
create unique index on the_table (least(from,to), greatest(from,to));
Akan mencegah penambahan (B,A,100) jika (A,B,100) sudah ada di tabel.