mirror of
https://github.com/ent/ent.git
synced 2026-05-04 00:20:58 +03:00
dialect/sql/schema: alter table for postgres
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/115 Reviewed By: alexsn Differential Revision: D18065988 fbshipit-source-id: a7d33bbebd63b01659bc5ba562ac85642dcd3d83
This commit is contained in:
committed by
Facebook Github Bot
parent
dff3067639
commit
2789257849
@@ -191,7 +191,7 @@ func (m *Migrate) apply(ctx context.Context, tx dialect.Tx, table string, change
|
||||
}
|
||||
}
|
||||
}
|
||||
b := sql.AlterTable(table)
|
||||
b := sql.Dialect(m.Dialect()).AlterTable(table)
|
||||
for _, c := range change.column.add {
|
||||
b.AddColumn(m.cBuilder(c))
|
||||
}
|
||||
@@ -200,7 +200,7 @@ func (m *Migrate) apply(ctx context.Context, tx dialect.Tx, table string, change
|
||||
}
|
||||
if m.dropColumn {
|
||||
for _, c := range change.column.drop {
|
||||
b.DropColumn(sql.Column(c.Name))
|
||||
b.DropColumn(sql.Dialect(m.Dialect()).Column(c.Name))
|
||||
}
|
||||
}
|
||||
// if there's actual action to execute on ALTER TABLE.
|
||||
|
||||
Reference in New Issue
Block a user