diff --git a/translators/sqlite.go b/translators/sqlite.go index 421b56d8..c7ae4e8f 100644 --- a/translators/sqlite.go +++ b/translators/sqlite.go @@ -35,10 +35,12 @@ func (p *SQLite) CreateTable(t fizz.Table) (string, error) { for _, c := range t.Columns { if c.Primary { switch strings.ToLower(c.ColType) { - case "integer": + case "integer", "int": s = fmt.Sprintf("\"%s\" INTEGER PRIMARY KEY AUTOINCREMENT", c.Name) case "uuid", "string": s = fmt.Sprintf("\"%s\" TEXT PRIMARY KEY", c.Name) + default: + return "", errors.Errorf("can not use %s as a primary key", c.ColType) } } else { s = p.buildColumn(c)