(db *sql.DB, dialect string)
| 823 | } |
| 824 | |
| 825 | func (ms MigrationSet) GetMigrationRecords(db *sql.DB, dialect string) ([]*MigrationRecord, error) { |
| 826 | dbMap, err := ms.getMigrationDbMap(db, dialect) |
| 827 | if err != nil { |
| 828 | return nil, err |
| 829 | } |
| 830 | |
| 831 | var records []*MigrationRecord |
| 832 | query := fmt.Sprintf("SELECT * FROM %s ORDER BY %s ASC", dbMap.Dialect.QuotedTableForQuery(ms.SchemaName, ms.getTableName()), dbMap.Dialect.QuoteField("id")) |
| 833 | _, err = dbMap.Select(&records, query) |
| 834 | if err != nil { |
| 835 | return nil, err |
| 836 | } |
| 837 | |
| 838 | return records, nil |
| 839 | } |
| 840 | |
| 841 | func (ms MigrationSet) getMigrationDbMap(db *sql.DB, dialect string) (*gorp.DbMap, error) { |
| 842 | d, ok := MigrationDialects[dialect] |
no test coverage detected