model.go

13 lines
1 2 3 4 5 6 7 8 9 10 11 12 13
package database

import "time"

// Model is the base type for all database entities.
// Embed this in your structs to get ID, CreatedAt, and UpdatedAt fields.
//
// IDs are auto-generated on Insert, timestamps are auto-set on Insert/Update.
type Model struct {
	ID        string
	CreatedAt time.Time
	UpdatedAt time.Time
}