mirror of https://github.com/status-im/migrate.git
parent
51acd3f3ad
commit
701bd68731
|
@ -21,8 +21,8 @@ var DefaultMigrationsTable = "schema_migrations"
|
|||
var dbLocked = false
|
||||
|
||||
var (
|
||||
ErrNilConfig = fmt.Errorf("no config")
|
||||
ErrNoKeyspace = fmt.Errorf("no keyspace provided")
|
||||
ErrNilConfig = fmt.Errorf("no config")
|
||||
ErrNoKeyspace = fmt.Errorf("no keyspace provided")
|
||||
ErrDatabaseDirty = fmt.Errorf("database is dirty")
|
||||
)
|
||||
|
||||
|
@ -36,7 +36,7 @@ type Cassandra struct {
|
|||
isLocked bool
|
||||
|
||||
// Open and WithInstance need to guarantee that config is never nil
|
||||
config *Config
|
||||
config *Config
|
||||
}
|
||||
|
||||
func (p *Cassandra) Open(url string) (database.Driver, error) {
|
||||
|
@ -154,7 +154,6 @@ func (p *Cassandra) SetVersion(version int, dirty bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
// Return current keyspace version
|
||||
func (p *Cassandra) Version() (version int, dirty bool, err error) {
|
||||
query := `SELECT version, dirty FROM "` + p.config.MigrationsTable + `" LIMIT 1`
|
||||
|
@ -192,7 +191,6 @@ func (p *Cassandra) Drop() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
// Ensure version table exists
|
||||
func (p *Cassandra) ensureVersionTable() error {
|
||||
err := p.session.Query(fmt.Sprintf("CREATE TABLE IF NOT EXISTS %s (version bigint, dirty boolean, PRIMARY KEY(version))", p.config.MigrationsTable)).Exec()
|
||||
|
@ -205,7 +203,6 @@ func (p *Cassandra) ensureVersionTable() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
// ParseConsistency wraps gocql.ParseConsistency
|
||||
// to return an error instead of a panicking.
|
||||
func parseConsistency(consistencyStr string) (consistency gocql.Consistency, err error) {
|
||||
|
|
Loading…
Reference in New Issue