locomote/node-migrate-orm2 — pull request #13 by benjie (2014-05-08 19:30:51+00:00)
Title: Fix SQLite double primary key issues.

When you have a PK like:

```
id: {
type: "number",
required: true,
serial: true,
primary: true
}
```

it generates the following SQL/error:

```
(orm/sqlite) CREATE TABLE `user` (`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ,
[...snip...],
PRIMARY KEY (`id`))
{ [Error: SQLITE_ERROR: table "user" has more than one primary key] errno: 1, code: 'SQLITE_ERROR' }
```

This pull request fixes this issue by not adding the field to the list of primary keys if it is already marked as a primary key.

Potential sources of failure:

- Calling your primary key something including the text ` PRIMARY KEY `
- Multiple SQLite primary keys where one uses `serial: true` (though this isn't new)