schemas

package
v0.0.0-...-c1cfc5e Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

schema

Schema

  • 数据库schema

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Testing

type Testing struct {
	Id                uint64     `gorm:"column:id;primaryKey;type:uint;autoIncrement;comment:ID"`
	ColumnUniqueIndex string     `gorm:"column:column_unique_index;uniqueIndex;type:string;size:255;not null;default:'';comment:唯一索引"`
	ColumnIndex       string     `gorm:"column:column_index;index;type:string;size:255;not null;default:0;comment:普通索引"`
	ColumnBool        bool       `gorm:"column:column_bool;type:bool;not null;default:0;comment:布尔值"`
	ColumnInt         int32      `gorm:"column:column_int;type:int;not null;default:0;comment:整型"`
	ColumnUint        uint32     `gorm:"column:column_uint;type:uint;not null;default:0;comment:整型:无符号"`
	ColumnInt64       int64      `gorm:"column:column_int64;type:int;not null;default:0;comment:整型:64位"`
	ColumnUint64      uint64     `gorm:"column:column_uint64;type:uint;not null;default:0;comment:整型:无符号64位"`
	ColumnFloat64     float64    `gorm:"column:column_float64;type:decimal(30,10);not null;default:0;comment:浮点型:64位"`
	ColumnString      string     `gorm:"column:column_string;type:string;size:255;not null;default:'';comment:字符串"`
	ColumnText        string     `gorm:"column:column_text;type:text;not null;comment:文本"`
	ColumnJSON        string     `gorm:"column:column_json;type:json;not null;comment:JSON"`
	ColumnBytes       []byte     `gorm:"column:column_bytes;type:bytes;not null;comment:字节"`
	CreatedTime       time.Time  `gorm:"column:column_created_time;type:time;not null;autoCreateTime:milli;comment:创建时间"`
	ColumnUpdatedTime time.Time  `gorm:"column:column_updated_time;type:time;not null;autoUpdateTime:milli;comment:更新时间"`
	ColumnDeletedTime *time.Time `gorm:"column:column_deleted_time;type:time;default:null;comment:删除时间"`

	// IgnoreReadWrite ignore this field when write and read with struct
	IgnoreReadWrite string `gorm:"-"`
	// IgnoreAll ignore this field when write/read and migrate with struct
	IgnoreAll string `gorm:"-:all"`
	// IgnoreMigration ignore this field when migrate with struct
	IgnoreMigration string `gorm:"-:migration"`
}

Testing test 文档地址:https://gorm.io/docs/models.html MySQL 支持 unsigned Postgres 不支持 unsigned MySQL 支持 auto_increment Postgres : serial or bigserial

var (
	TestingSchema Testing
)

func (*Testing) AddColumnAccessToken

func (s *Testing) AddColumnAccessToken(migrator gorm.Migrator) migrationpkg.MigrationInterface

AddColumnAccessToken 添加字段

func (*Testing) CreateTableMigrator

func (s *Testing) CreateTableMigrator(migrator gorm.Migrator) migrationpkg.MigrationInterface

CreateTableMigrator create table migrator

func (*Testing) CreateUniqueIndexForIntAndUint

func (s *Testing) CreateUniqueIndexForIntAndUint(migrator gorm.Migrator) migrationpkg.MigrationInterface

CreateUniqueIndexForIntAndUint 创建唯一索引

func (*Testing) DropTableMigrator

func (s *Testing) DropTableMigrator(migrator gorm.Migrator) migrationpkg.MigrationInterface

DropTableMigrator create table migrator

func (*Testing) TableName

func (s *Testing) TableName() string

TableName 表名

type TestingUniqueIndex

type TestingUniqueIndex struct {
	ColumnInt  int32  `gorm:"column:column_int;uniqueIndex:idx_testing_int_uint;type:int;not null;default:0;comment:整型"`
	ColumnUint uint32 `gorm:"column:column_uint;uniqueIndex:idx_testing_int_uint;type:uint;not null;default:0;comment:整型:无符号"`
}

TestingUniqueIndex ...

func (*TestingUniqueIndex) IndexName

func (s *TestingUniqueIndex) IndexName() string

func (*TestingUniqueIndex) TableName

func (s *TestingUniqueIndex) TableName() string

TableName table name

Jump to

Keyboard shortcuts

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