models

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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