Implement schemagen ignore-indexes flag
Co-authored by Alexander Setzer <Alexander.Setzer@alfatraining.de>
This commit is contained in:
committed by
Roy Dahan
parent
e8f30f8dda
commit
8bda349563
@@ -25,6 +25,8 @@ func TestSchemagen(t *testing.T) {
|
||||
"composers_by_name",
|
||||
"label",
|
||||
}, ",")
|
||||
*flagIgnoreIndexes = true
|
||||
|
||||
b := runSchemagen(t, "foobar")
|
||||
|
||||
const goldenFile = "testdata/models.go.txt"
|
||||
@@ -153,6 +155,11 @@ func createTestSchema(t *testing.T) {
|
||||
t.Fatal("create table:", err)
|
||||
}
|
||||
|
||||
err = session.ExecStmt(`CREATE INDEX IF NOT EXISTS songs_title ON schemagen.songs (title)`)
|
||||
if err != nil {
|
||||
t.Fatal("create index:", err)
|
||||
}
|
||||
|
||||
err = session.ExecStmt(`CREATE TABLE IF NOT EXISTS schemagen.composers (
|
||||
id uuid PRIMARY KEY,
|
||||
name text)`)
|
||||
|
||||
Reference in New Issue
Block a user