mirror of
https://github.com/ent/ent.git
synced 2026-05-01 23:20:53 +03:00
dialect/sql/schema: index builders per dialect
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/118 Reviewed By: alexsn Differential Revision: D18092371 fbshipit-source-id: 02b85724b1e00d10c930112b9e2c8d07c8727216
This commit is contained in:
committed by
Facebook Github Bot
parent
c414cd9a82
commit
88bfbc38df
@@ -61,11 +61,19 @@ func (d *SQLite) setRange(ctx context.Context, tx dialect.Tx, name string, value
|
||||
return tx.Exec(ctx, query, args, new(sql.Result))
|
||||
}
|
||||
|
||||
// fkExist returns always true to disable foreign-keys creation after the table was created.
|
||||
func (d *SQLite) fkExist(context.Context, dialect.Tx, string) (bool, error) { return true, nil }
|
||||
func (d *SQLite) table(context.Context, dialect.Tx, string) (*Table, error) { return nil, nil }
|
||||
|
||||
func (*SQLite) cType(c *Column) string { return c.SQLiteType() }
|
||||
func (*SQLite) tBuilder(t *Table) *sql.TableBuilder { return t.SQLite() }
|
||||
func (*SQLite) addColumn(c *Column) *sql.ColumnBuilder { return c.SQLite() }
|
||||
func (*SQLite) alterColumn(c *Column) []*sql.ColumnBuilder { return []*sql.ColumnBuilder{c.SQLite()} }
|
||||
|
||||
// fkExist returns always tru to disable foreign-keys creation after the table was created.
|
||||
func (d *SQLite) fkExist(context.Context, dialect.Tx, string) (bool, error) { return true, nil }
|
||||
func (d *SQLite) table(context.Context, dialect.Tx, string) (*Table, error) { return nil, nil }
|
||||
func (d *SQLite) addIndex(i *Index, table string) *sql.IndexBuilder {
|
||||
return i.Builder(table)
|
||||
}
|
||||
|
||||
func (d *SQLite) dropIndex(i *Index, _ string) *sql.DropIndexBuilder {
|
||||
return i.DropBuilder("")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user