diff --git a/cmd/atlas/internal/migratelint/run.go b/cmd/atlas/internal/migratelint/run.go index 89e39bb231a..7314e89c258 100644 --- a/cmd/atlas/internal/migratelint/run.go +++ b/cmd/atlas/internal/migratelint/run.go @@ -332,6 +332,9 @@ type ( TotalFiles int `json:"-"` // Total number of files to analyze. } + // FileChange specifies whether the file was added, deleted or changed. + FileChange string + // StepReport contains a summary of the analysis of a single step. StepReport struct { Name string `json:"Name,omitempty"` // Step name. @@ -346,6 +349,7 @@ type ( Text string `json:"Text,omitempty"` // Contents of the file. Reports []sqlcheck.Report `json:"Reports,omitempty"` // List of reports. Error string `json:"Error,omitempty"` // File specific error. + Change FileChange `json:"Change,omitempty"` // Change of the file. // Logging only info. Start time.Time `json:"-"` // Start time of the analysis. @@ -369,6 +373,12 @@ type ( SilentError struct{ error } ) +const ( + FileChangeAdded FileChange = "ADDED" + FileChangeDeleted FileChange = "DELETED" + FileChangeModified FileChange = "MODIFIED" +) + // NewSummaryReport returns a new SummaryReport. func NewSummaryReport(c *sqlclient.Client, dir migrate.Dir) *SummaryReport { sum := &SummaryReport{