From d272c0922f240019e65f6e53c24a06410ca11b01 Mon Sep 17 00:00:00 2001 From: Ivan Ryabov Date: Thu, 17 Oct 2024 00:17:25 +1100 Subject: [PATCH] Include index options --- migrator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/migrator.go b/migrator.go index 7c093df..3452c5e 100644 --- a/migrator.go +++ b/migrator.go @@ -142,6 +142,10 @@ func (m Migrator) CreateIndex(value interface{}, name string) error { createIndexSQL += " ?" } + if idx.Option != "" { + createIndexSQL += " " + idx.Option + } + if idx.Where != "" { createIndexSQL += " WHERE " + idx.Where }