Files
hammy-backend/internal/db/models.go
T
2026-09-06 19:22:47 +02:00

125 lines
3.1 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package db
import (
"github.com/jackc/pgx/v5/pgtype"
)
// Several active keys per owner is intentional: people leak keys into public repositories, and rotating needs an overlap window where both the old and new key work.
type ApiKey struct {
ID int64
OwnerID int64
KeyHash []byte
KeyPrefix string
Label *string
Scopes []string
QuotaTier string
Status string
CreatedAt pgtype.Timestamptz
ExpiresAt pgtype.Timestamptz
LastUsedAt pgtype.Timestamptz
RevokedAt pgtype.Timestamptz
RevokedReason *string
}
// Registrants for API keys. Holds PII from an international user base, so the deletion path in 005_privacy.sql applies here too, not just to Discord users.
type ApiOwner struct {
ID int64
Email string
EmailVerifiedAt pgtype.Timestamptz
Callsign interface{}
CallsignVerifiedAt pgtype.Timestamptz
Status string
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type ApiUsageDaily struct {
KeyID int64
Day pgtype.Date
Endpoint string
Calls int64
Errors int64
DistinctUsers int32
}
type CoreSubscription struct {
ID int64
GuildID *int64
ChannelID int64
UserID *int64
Kind string
Filters []byte
Enabled bool
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
// One row per Discord user who has interacted with a stateful command. Deliberately no soft-delete column: a deletion request must actually remove the row, so there is nothing left to resurrect.
type CoreUser struct {
ID int64
DiscordID int64
Callsign interface{}
CallsignVerifiedAt pgtype.Timestamptz
VerificationMethod *string
Grid interface{}
Timezone *string
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type CoreVerification struct {
ID int64
UserID int64
Method string
Callsign string
Status string
ChallengeHash []byte
Detail []byte
CreatedAt pgtype.Timestamptz
ExpiresAt pgtype.Timestamptz
CompletedAt pgtype.Timestamptz
}
type LogbookImport struct {
ID int64
UserID int64
Filename *string
Source *string
Status string
RowsTotal int32
RowsAccepted int32
RowsDuplicate int32
RowsRejected int32
Error *string
StartedAt pgtype.Timestamptz
FinishedAt pgtype.Timestamptz
}
type LogbookQso struct {
ID int64
UserID int64
ImportID *int64
Callsign string
QsoAt pgtype.Timestamptz
// Truncated copy of qso_at used only for duplicate detection. Do not query it directly; use qso_at.
QsoMinute pgtype.Timestamp
Band *string
Mode *string
Submode *string
FreqHz *int64
RstSent *string
RstRcvd *string
Grid interface{}
Dxcc *int32
CqZone *int16
ItuZone *int16
TxPowerW pgtype.Numeric
Comment *string
Extra []byte
CreatedAt pgtype.Timestamptz
}