models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package models holds GORM fixtures for the multi-DB conformance suite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	gorm.Model
	Code     string          `gorm:"size:64;uniqueIndex;not null"`
	Name     string          `gorm:"size:120;index;not null"`
	Notes    *string         `gorm:"size:255"`
	Price    decimal.Decimal `gorm:"type:decimal(19,4);not null"`
	Discount types.Decimal   `gorm:"type:decimal(19,4);not null"`
}

Item exercises portable schema features required by M2-4 conformance: timestamps (via gorm.Model), nullable columns, unique + non-unique indexes, and decimal storage. Discount uses the framework types.Decimal wrapper (#222) so the shared money type is covered across the SQLite/PostgreSQL/MySQL matrix.

func (Item) TableName

func (Item) TableName() string

TableName returns the stable table name for Atlas-generated migrations.

Jump to

Keyboard shortcuts

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