     }
     
     override var databasePrimaryKey : [String: DatabaseValue?] {
-        return ["ID": ID]
+        return ["UUID": UUID]
     }
     
     override func updateFromDatabaseRow(row: Row) {
-        if row.hasColumn("ID") { ID = row.value(named: "ID") }
+        if row.hasColumn("UUID") { UUID = row.value(named: "UUID") }
         if row.hasColumn("name") { name = row.value(named: "name") }
         if row.hasColumn("masterID") { masterID = row.value(named: "masterID") }
     }

    }
}

class RowModelTests: GRDBTests {
    override func setUp() {
        super.setUp()

        var migrator = DatabaseMigrator()
        migrator.registerMigration("createPersons") { db in
            try db.execute(
                "CREATE TABLE persons (" +
                    "ID INTEGER PRIMARY KEY, " +
                    "name TEXT NOT NULL, " +
                "age INT)")
        }
        migrator.registerMigration("createPets") { db in
            try db.execute(
                "CREATE TABLE pets (" +
                    "ID INTEGER PRIMARY KEY, " +
                    "masterID INTEGER NOT NULL " +
                    "         REFERENCES persons(ID) " +
                    "         ON DELETE CASCADE ON UPDATE CASCADE, " +
                "name TEXT)")
        }
        try! migrator.migrate(dbQueue)
    }
    
    func testInsert() {
        assertNoError {
            let arthur = Person(name: "Arthur", age: 41)
            
            XCTAssertTrue(arthur.ID == nil)
            try dbQueue.inTransaction { db in
                try arthur.insert(db)
                return .Commit
            }
            XCTAssertTrue(arthur.ID != nil)
        }
    }
    
    func testInsertTwiceBreaksUniqueIndex() {
        assertNoError {
            let arthur = Person(name: "Arthur", age: 41)
            

    var ID: Int64?
    var name: String?
    var age: Int?
    
    override var tableName: String? {
        return "persons"
    }
