schema

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RootCause

type RootCause struct {
	ent.Schema
}

RootCause holds the schema definition for the RootCause entity, mirroring rootcause.RootCause (github.com/plexusone/signal-spec/pkg/rootcause) minus its Embedding field, which lives in the rootcause_vec vec0 table instead (see the Signal schema's doc comment for why). SignalIDs is also not stored here — it's derived at read time from SignalRootCauseLink so it can't drift out of sync with the actual links.

func (RootCause) Fields

func (RootCause) Fields() []ent.Field

Fields of the RootCause.

func (RootCause) Indexes

func (RootCause) Indexes() []ent.Index

Indexes of the RootCause.

type Signal

type Signal struct {
	ent.Schema
}

Signal holds the schema definition for the Signal entity, mirroring signal.Signal (github.com/plexusone/signal-spec/pkg/signal) minus its Embedding field, which lives in the signal_vec vec0 table instead — Ent has no concept of SQLite virtual tables, so the two are kept separate and joined on id, the same way aha-studio keeps FTS5 tables alongside Ent.

func (Signal) Fields

func (Signal) Fields() []ent.Field

Fields of the Signal.

func (Signal) Indexes

func (Signal) Indexes() []ent.Index

Indexes of the Signal.

type SignalRootCauseLink struct {
	ent.Schema
}

SignalRootCauseLink holds the schema definition for the link between a Signal and the RootCause it's attached to.

This is a dedicated table rather than a root_cause_id column on Signal because consolidate.Pipeline calls Store.LinkSignal(sig.ID, rc.ID) (consolidate/consolidate.go processRaw/Attach) without ever calling SaveSignal first — a column on Signal would silently no-op the link for signals that were never explicitly persisted. The unique index on signal_id makes LinkSignal an upsert (insert or re-point on conflict), which also models reattachment cleanly: reject -> re-review -> re-link moves the pointer instead of accumulating duplicate links.

func (SignalRootCauseLink) Fields

func (SignalRootCauseLink) Fields() []ent.Field

Fields of the SignalRootCauseLink.

func (SignalRootCauseLink) Indexes

func (SignalRootCauseLink) Indexes() []ent.Index

Indexes of the SignalRootCauseLink.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL