go-gorm / postgres

GORM PostgreSQL driver
MIT License
234 stars 123 forks source link

Add create index concurrently option #47

Closed s-takehana closed 3 years ago

s-takehana commented 3 years ago

What did this pull request do?

Related to go-gorm/gorm#4423.

https://www.postgresql.org/docs/current/sql-createindex.html

User Case Description

type User struct {
    gorm.Model
    Name string `gorm:"index:,option:CONCURRENTLY"`
}
2021/05/19 03:56:58 /go/pkg/mod/gorm.io/driver/postgres@v1.0.8/migrator.go:134
[6.462ms] [rows:0] CREATE INDEX CONCURRENTLY "idx_users_name" ON "users" ("name")
jinzhu commented 3 years ago

thank you for your PR.