Commit 7e10f97b authored by gwenn's avatar gwenn

Remove AUTOINCREMENT keyword.

parent 672aaeb9
......@@ -7,7 +7,7 @@ import (
func fill(db *Conn, n int) {
db.Exec("DROP TABLE IF EXISTS test")
db.Exec("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, float_num REAL, int_num INTEGER, a_string TEXT)")
db.Exec("CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL, float_num REAL, int_num INTEGER, a_string TEXT)")
s, _ := db.Prepare("INSERT INTO test (float_num, int_num, a_string) VALUES (?, ?, ?)")
db.Begin()
......@@ -88,7 +88,7 @@ func BenchmarkNamedInsert(b *testing.B) {
db, _ := Open("")
defer db.Close()
db.Exec("DROP TABLE IF EXISTS test")
db.Exec("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT," +
db.Exec("CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL," +
" float_num REAL, int_num INTEGER, a_string TEXT)")
s, _ := db.Prepare("INSERT INTO test (float_num, int_num, a_string)" +
" VALUES (:f, :i, :s)")
......
......@@ -7,7 +7,7 @@ import (
const (
ddl = "DROP TABLE IF EXISTS test;" +
"CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT," +
"CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL," +
" name TEXT);"
dml = "INSERT INTO test (name) values ('Bart');" +
"INSERT INTO test (name) values ('Lisa');" +
......
......@@ -74,8 +74,8 @@ func TestColumn(t *testing.T) {
if !column.Pk {
t.Errorf("Expecting primary key flag to be true")
}
if !column.Autoinc {
t.Errorf("Expecting autoinc flag to be true")
if column.Autoinc {
t.Errorf("Expecting autoinc flag to be false")
}
}
......@@ -83,8 +83,8 @@ func TestForeignKeys(t *testing.T) {
db := open(t)
defer db.Close()
err := db.Exec("CREATE TABLE parent (id INTEGER PRIMARY KEY);" +
"CREATE TABLE child (id INTEGER PRIMARY KEY, parentId INTEGER, " +
err := db.Exec("CREATE TABLE parent (id INTEGER PRIMARY KEY NOT NULL);" +
"CREATE TABLE child (id INTEGER PRIMARY KEY NOT NULL, parentId INTEGER, " +
"FOREIGN KEY (parentId) REFERENCES parent(id));")
checkNoError(t, err, "error creating tables: %s")
fks, err := db.ForeignKeys("child")
......
......@@ -25,7 +25,7 @@ func open(t *testing.T) *Conn {
func createTable(db *Conn, t *testing.T) {
err := db.Exec("DROP TABLE IF EXISTS test;" +
"CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT," +
"CREATE TABLE test (id INTEGER PRIMARY KEY NOT NULL," +
" float_num REAL, int_num INTEGER, a_string TEXT); -- bim")
checkNoError(t, err, "error creating table: %s")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment