Skip to content

Commit

Permalink
Merge pull request #21 from ollionorg/support-check-constraint-backend
Browse files Browse the repository at this point in the history
Support check constraint backend
  • Loading branch information
akashthawaitcc authored Dec 26, 2024
2 parents 731346f + f220876 commit ef3c414
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const (
DEFAUT_EXPRESSION = "DEFAULT"
DEFAULT_GENERATED = "DEFAULT_GENERATED"
TEMP_DB = "smt-staging-db"

// Regex for matching database collation
DB_COLLATION_REGEX = `(_[a-zA-Z0-9]+\\|\\)`
)
9 changes: 5 additions & 4 deletions internal/reports/report_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,17 @@ func buildTableReportBody(conv *internal.Conv, tableId string, issues map[string
Description: fmt.Sprintf("UNIQUE constraint on column(s) '%s' replaced with primary key since table '%s' didn't have one. Spanner requires a primary key for every table", strings.Join(uniquePK, ", "), conv.SpSchema[tableId].Name),
}
l = append(l, toAppend)
case internal.DefaultValueError:
case internal.TypeMismatch:
toAppend := Issue{
Category: IssueDB[i].Category,
Description: fmt.Sprintf("%s for table '%s' column '%s'", IssueDB[i].Brief, conv.SpSchema[tableId].Name, spColName),
Description: fmt.Sprintf("Table '%s': Type mismatch in '%s'column affecting check constraints. Verify data type compatibility with constraint logic", conv.SpSchema[tableId].Name, conv.SpSchema[tableId].ColDefs[colId].Name),
}
l = append(l, toAppend)
case internal.TypeMismatch:

case internal.DefaultValueError:
toAppend := Issue{
Category: IssueDB[i].Category,
Description: fmt.Sprintf("Table '%s': Type mismatch in '%s'column affecting check constraints. Verify data type compatibility with constraint logic", conv.SpSchema[tableId].Name, conv.SpSchema[tableId].ColDefs[colId].Name),
Description: fmt.Sprintf("%s for table '%s' column '%s'", IssueDB[i].Brief, conv.SpSchema[tableId].Name, spColName),
}
l = append(l, toAppend)

Expand Down
1 change: 1 addition & 0 deletions ui/dist/ui/main.1cfa12bd9a851a7a.js

Large diffs are not rendered by default.

0 comments on commit ef3c414

Please sign in to comment.