From 8c50273390b270a8fc621eabc28ba572bffbc31c Mon Sep 17 00:00:00 2001 From: Ryan Slade Date: Thu, 19 Dec 2024 15:09:01 +0100 Subject: [PATCH] Move single checks to top of function --- pkg/sql2pgroll/create_index.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/sql2pgroll/create_index.go b/pkg/sql2pgroll/create_index.go index e600c3fe5..797e19e51 100644 --- a/pkg/sql2pgroll/create_index.go +++ b/pkg/sql2pgroll/create_index.go @@ -90,6 +90,12 @@ func canConvertCreateIndexStmt(stmt *pgq.IndexStmt) bool { if len(stmt.GetOptions()) > 1 { return false } + if stmt.GetTableSpace() != "" { + return false + } + if stmt.GetIndexIncludingParams() != nil { + return false + } for _, param := range stmt.GetIndexParams() { if param.GetIndexElem().GetCollation() != nil { return false @@ -105,12 +111,6 @@ func canConvertCreateIndexStmt(stmt *pgq.IndexStmt) bool { return false } } - if stmt.GetTableSpace() != "" { - return false - } - if stmt.GetIndexIncludingParams() != nil { - return false - } return true }