Skip to content

Commit

Permalink
docs(readme): correct example in readme.md (#84) [ci skip]
Browse files Browse the repository at this point in the history
sql.js:20 Uncaught (in promise) Error: table "games" has more than one primary key
    at Database../node_modules/sql.js/js/sql.js.Database.handleError (sql.js:20)
    at Database../node_modules/sql.js/js/sql.js.Database.run (sql.js:20)
    at trilogy.js:278
    at <anonymous>

Primary key duped in table "game". It is needed to remove one.
  • Loading branch information
YagoLopez authored and haltcase committed Feb 18, 2018
1 parent 2e96af3 commit 9f9e839
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ const db = new Trilogy(':memory:', {

;(async function () {
const games = await db.model('games', {
name: { type: String, primary: true }, // primary key
name: { type: String },
genre: String, // type shorthand
released: Date,
awards: Array,
id: 'increments' // special type
id: 'increments' // special type, primary key
})

await games.create({
Expand Down

0 comments on commit 9f9e839

Please sign in to comment.