sqlchemy icon indicating copy to clipboard operation
sqlchemy copied to clipboard

Support mysql unique key

Open donychen1134 opened this issue 1 year ago • 0 comments

Requesting support for MySQL's unique key.

In the code blow, the unique type of idx has been ignored by the function createIndexSQL

func createIndexSQL(ts sqlchemy.ITableSpec, idx sqlchemy.STableIndex) string {
	return fmt.Sprintf("CREATE INDEX `%s` ON `%s` (%s)", idx.Name(), ts.Name(), strings.Join(idx.QuotedColumns("`"), ","))
}

https://github.com/yunionio/sqlchemy/blob/master/backends/mysql/sync.go#L141

Can you please support MySQL unique key?

donychen1134 avatar Jun 28 '24 08:06 donychen1134