Skip to content

Commit

Permalink
tweak select
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
  • Loading branch information
gabriel-samfira committed Jun 29, 2023
1 parent 3ba9a63 commit e6fd812
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion database/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (s *sqlDatabase) cascadeMigrationSQLite(model interface{}, name string, jus

var data string
var indexes []string
if err := s.conn.Raw(fmt.Sprintf("select sql from sqlite_master where tbl_name='%s' and name='%s'", name, name)).Scan(&data).Error; err != nil {
if err := s.conn.Raw(fmt.Sprintf("select sql from sqlite_master where type='table' and tbl_name='%s'", name)).Scan(&data).Error; err != nil {
if !errors.Is(err, gorm.ErrRecordNotFound) {
return fmt.Errorf("failed to get table %s: %w", name, err)
}
Expand Down

0 comments on commit e6fd812

Please sign in to comment.