title: Specify sorting criteria manually for a set of records of a many-to-many relationship
body: <p>I am designing a many-to-many relationship between two models: <code>Cell</code> and <code>Isolator</code>:</p>
  
  <pre><code>CREATE TABLE `isolator` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `name` varchar(127) NOT NULL,
    `surname` varchar(127) NOT NULL,
    PRIMARY KEY (`id`),
  );
  
  CREATE TABLE `cell` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `name` varchar(127) NOT NULL,
    `gen` varchar(127) NOT NULL,
    PRIMARY KEY (`id`),
  );
  
  CREATE TABLE `cell_isolators` (
    `cell_id` bigint(20) NOT NULL DEFAULT '0',
    `isolator_id` bigint(20) NOT NULL DEFAULT '0',
    PRIMARY KEY (`cell_id`,`isolator_id`),
    CONSTRAINT `cell_isolator_id` FOREIGN KEY (`isolator_id`) REFERENCES `isolator` (`id`),
    CONSTRAINT `isolator_cell_id` FOREIGN KEY (`cell_id`) REFERENCES `cell` (`id`) ON DELETE CASCADE
  );
  </code></pre>
  
  <p>The client has asked me the possibility of specifying the order on which the list of isolators for a cell is shown, since it's important for publication purposes.</p>
  
  <p>What is the best approach to model that? I was thinking on adding a third field to the many-to-many relation (e.g. <code>sort_order</code>), but I would like to know if there are other alternatives.</p>
  
  <p>Thanks!</p>