Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
covrom committed Feb 2, 2021
1 parent 92a22ed commit 95ac0a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ sql/test_ddl_full.sql
schema/yaml_test.go
schema2.puml
schema2.yaml
.vscode/launch.json
13 changes: 13 additions & 0 deletions schema/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,19 @@ func (s *PatchSchema) Build(from, to *Schema) {
}
pt.columns = append(pt.columns, pc)
}
if rt != nil {
for _, c := range rt.Columns {
pc := &PatchColumn{
tableName: t.Name,
to: c,
}
tc, err := t.FindColumnByName(c.Name)
if err == nil {
pc.from = tc
}
pt.columns = append(pt.columns, pc)
}
}
for _, idx := range t.Indexes {
pi := &PatchIndex{
from: idx,
Expand Down

0 comments on commit 95ac0a7

Please sign in to comment.