imporve sql migration (#3)

Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/3

add an append-only mode to the migration

Reviewed By: alexsn

Differential Revision: D15845370

fbshipit-source-id: f22ae1866d4bb9250bf2d1c6cba476d574a3f45d
This commit is contained in:
Ariel Mashraki
2019-06-17 04:09:15 -07:00
committed by Facebook Github Bot
parent 267e3c15bd
commit 4f31aa6cfe
5 changed files with 174 additions and 23 deletions

View File

@@ -274,7 +274,7 @@ func AlterTable(name string) *TableAlter { return &TableAlter{b: Builder{}, name
// AddColumn appends the `ADD COLUMN` clause to the given `ALTER TABLE` statement.
func (t *TableAlter) AddColumn(c *ColumnBuilder) *TableAlter {
t.nodes = append(t.nodes, &Wrapper{"ADD %s", c})
t.nodes = append(t.nodes, &Wrapper{"ADD COLUMN %s", c})
return t
}