/
migrate_oss.go
39 lines (31 loc) · 1.01 KB
/
migrate_oss.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2021-present The Atlas Authors. All rights reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.
//go:build !ent
package migrate
import (
"context"
"fmt"
)
// IsCheckpoint reports whether the file is a checkpoint file.
func (f *LocalFile) IsCheckpoint() bool {
return f.isCheckpoint()
}
// CheckpointTag returns the tag of the checkpoint file, if defined.
func (f *LocalFile) CheckpointTag() (string, error) {
return f.checkpointTag()
}
// fileStmts returns the statements defined in the given file.
func (e *Executor) fileStmts(f File) ([]string, error) {
return FileStmts(e.drv, f)
}
func (e *Executor) fileChecks(context.Context, File, *Revision) error {
return nil // unimplemented
}
// ValidateDir before operating on it.
func (e *Executor) ValidateDir(context.Context) error {
if err := Validate(e.dir); err != nil {
return fmt.Errorf("sql/migrate: validate migration directory: %w", err)
}
return nil
}