model

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const DDLPrimaryKey = "primaryKey"
View Source
const DDLUniqueIndex = "uniqueIndex"

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Field      string `json:"field" orm:"column_name"`      // 字段名
	Type       string `json:"type" orm:"column_type"`       // 字段类型
	Kind       string `json:"kind" orm:"DATA_TYPE"`         // 字段类型
	Comment    string `json:"comment" orm:"column_comment"` // 字段注释
	TableName  string `json:"tableName" orm:"table_name"`   //
	Default    string `orm:"COLUMN_DEFAULT"`                //
	NotNull    string `orm:"IS_NULLABLE"`                   // not null/null
	EXTRA      string
	Size       string `orm:"NUMERIC_PRECISION"`
	PrimaryKey bool
	DDLTag     map[string]string
}

type Index

type Index struct {
	Unique    bool   `orm:"non_unique"`
	Name      string `orm:"index_name"`
	Columns   []string
	TableName string `orm:"table_name"`
}

type Schema

type Schema struct {
	Tables    map[string]*Table
	NoComment bool
}

type SyncTask

type SyncTask struct {
	CreateTable  []Table
	AddColumn    []Column
	AlterColumn  []Column
	AddIndex     []Index
	SchemaInCode Schema
}

type Table

type Table struct {
	Name    string `orm:"table_name"`
	Comment string `orm:"table_comment"`
	Charset string
	Columns []Column
	Index   []Index
}

Jump to

Keyboard shortcuts

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