Don't run database migrations by commenting out the function that does them. This eliminates silly build-location dependencies.

This commit is contained in:
Joshua Kroll 2016-06-02 20:07:35 -07:00
parent cc22bd284c
commit 464514b2ea
2 changed files with 8 additions and 7 deletions

View File

@ -23,10 +23,10 @@ import (
"syscall"
"time"
"github.com/cloudflare/clair/database/pgsql"
"github.com/coreos/clair/api"
"github.com/coreos/clair/api/context"
"github.com/coreos/clair/config"
"github.com/coreos/clair/database/pgsql"
"github.com/coreos/clair/notifier"
"github.com/coreos/clair/updater"
"github.com/coreos/clair/utils"

View File

@ -26,12 +26,12 @@ import (
"time"
"bitbucket.org/liamstask/goose/lib/goose"
"github.com/cloudflare/clair/vendor/github.com/hashicorp/golang-lru"
"github.com/coreos/clair/config"
"github.com/coreos/clair/database"
"github.com/coreos/clair/utils"
cerrors "github.com/coreos/clair/utils/errors"
"github.com/coreos/pkg/capnslog"
"github.com/hashicorp/golang-lru"
"github.com/lib/pq"
"github.com/pborman/uuid"
"github.com/prometheus/client_golang/prometheus"
@ -96,11 +96,12 @@ func (pgSQL *pgSQL) Ping() bool {
//
// It will run immediately every necessary migration on the database.
func Open(config *config.DatabaseConfig) (database.Datastore, error) {
// Run migrations.
if err := migrate(config.Source); err != nil {
log.Error(err)
return nil, database.ErrCantOpen
}
// jkroll 2016-06-02: Cut out migrations to build a package, so we can avoid this runtime
// // Run migrations.
// if err := migrate(config.Source); err != nil {
// log.Error(err)
// return nil, database.ErrCantOpen
// }
// Open database.
db, err := sql.Open("postgres", config.Source)