Disable generating enums from the views for MySQL/MariaDB.
This commit is contained in:
parent
bec0d59be3
commit
bcdab0f111
2 changed files with 6 additions and 6 deletions
|
|
@ -95,10 +95,10 @@ ORDER BY ordinal_position;
|
|||
|
||||
func (m *MySqlQuerySet) ListOfEnumsQuery() string {
|
||||
return `
|
||||
SELECT (CASE DATA_TYPE WHEN 'enum' then CONCAT(TABLE_NAME, '_', COLUMN_NAME) ELSE '' END ), SUBSTRING(COLUMN_TYPE,5)
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = ?
|
||||
AND DATA_TYPE = 'enum';
|
||||
SELECT (CASE c.DATA_TYPE WHEN 'enum' then CONCAT(c.TABLE_NAME, '_', c.COLUMN_NAME) ELSE '' END ), SUBSTRING(c.COLUMN_TYPE,5)
|
||||
FROM information_schema.columns as c
|
||||
INNER JOIN information_schema.tables as t on (t.table_schema = c.table_schema AND t.table_name = c.table_name)
|
||||
WHERE c.table_schema = ? AND DATA_TYPE = 'enum' AND t.TABLE_TYPE = 'BASE TABLE';
|
||||
`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ func assertGeneratedFiles(t *testing.T) {
|
|||
enumFiles, err := ioutil.ReadDir(genTestDir3 + "/dvds/enum")
|
||||
assert.NilError(t, err)
|
||||
|
||||
assertFileNameEqual(t, enumFiles, "film_list_rating.go", "film_rating.go", "nicer_but_slower_film_list_rating.go")
|
||||
assertFileNameEqual(t, enumFiles, "film_rating.go")
|
||||
assertFileContent(t, genTestDir3+"/dvds/enum/film_rating.go", "\npackage enum", mpaaRatingEnumFile)
|
||||
|
||||
// Model files
|
||||
|
|
@ -82,7 +82,7 @@ func assertGeneratedFiles(t *testing.T) {
|
|||
|
||||
assertFileNameEqual(t, modelFiles, "actor.go", "address.go", "category.go", "city.go", "country.go",
|
||||
"customer.go", "film.go", "film_actor.go", "film_category.go", "inventory.go", "language.go",
|
||||
"payment.go", "rental.go", "staff.go", "store.go", "film_list_rating.go", "film_rating.go", "nicer_but_slower_film_list_rating.go")
|
||||
"payment.go", "rental.go", "staff.go", "store.go", "film_rating.go")
|
||||
|
||||
assertFileContent(t, genTestDir3+"/dvds/model/actor.go", "\npackage model", actorModelFile)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue