-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiffTable.go
More file actions
34 lines (27 loc) · 825 Bytes
/
diffTable.go
File metadata and controls
34 lines (27 loc) · 825 Bytes
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
package model
import "strings"
type DiffTable struct {
Name string
Comment string
IsNew bool
DiffColumns []DiffColumn
DiffIndexes []DiffIndex
DiffPks []DiffColumn
}
type DiffTableSlice []*DiffTable
func (p DiffTableSlice) Len() int { return len(p) }
func (p DiffTableSlice) Less(i, j int) bool { return strings.Compare(p[i].Name, p[j].Name) < 0 }
func (p DiffTableSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
type DiffColumn struct {
Name string
OldColumn *Column
NewColumn *Column
}
type DiffIndex struct {
Name string
OldIndex *Index
NewIndex *Index
}
func NewDiffTable(physicalName, comment string) *DiffTable {
return &DiffTable{Name: physicalName, Comment: comment, DiffColumns: []DiffColumn{}, DiffIndexes: []DiffIndex{}, DiffPks: []DiffColumn{}}
}