From c3cf6b04694a97f6e872e48b4c672a898353717d Mon Sep 17 00:00:00 2001 From: Tomas Kocman Date: Mon, 14 Oct 2024 10:10:18 +0200 Subject: [PATCH] feat: ID generator uses uuidV7 --- CHANGELOG.md | 3 +++ cmd/tea/gen_id.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79fc2d4..98e12b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ How to release a new version: - Print to stderr on error. - `gen_id` now includes a comment at the top of the generated file to warn developers that the file is, in fact, generated. +### Changed +- Command for ID generating: uses uuidV7 instead of uuidV4. + ### Removed - `openapi compose`, `repo init`, `repo template` commands. diff --git a/cmd/tea/gen_id.go b/cmd/tea/gen_id.go index e1f36d9..8e2b49d 100644 --- a/cmd/tea/gen_id.go +++ b/cmd/tea/gen_id.go @@ -103,7 +103,7 @@ func scanUUID(u *uuid.UUID, idTypeName string, data any) error { } {{ range .ids }} func New{{ . }}() {{ . }} { - return {{ . }}(uuid.New()) + return {{ . }}(uuid.Must(uuid.NewV7())) } func (i {{ . }}) String() string {