Skip to content

Conversation

@molon
Copy link
Contributor

@molon molon commented Nov 20, 2025

Note

Adds HardDeleteModel (no soft delete) with BeforeCreate hook to auto-assign UUIDs.

  • Models (gormx/model.go):
    • New HardDeleteModel: Base model without DeletedAt (hard deletes) containing ID, CreatedAt, UpdatedAt.
    • Hook: BeforeCreate sets ID to a new UUID when empty.

Written by Cursor Bugbot for commit e3541ac. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings November 20, 2025 15:19
Copilot finished reviewing on behalf of molon November 20, 2025 15:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a HardDeleteModel struct as an alternative to the existing Model struct for scenarios where permanent deletion (without soft-delete capability) is required. The new model follows the same pattern as the existing Model with automatic UUID generation via a BeforeCreate hook, but omits the DeletedAt field to prevent soft-delete behavior.

  • Adds HardDeleteModel struct with ID, CreatedAt, and UpdatedAt fields
  • Implements BeforeCreate hook for automatic UUID generation
  • Provides a model option for tables that require permanent deletions instead of soft deletes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants