migrations

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnitTypeCode            = iota + 1 // 1 code
	UnitTypeIssues                     // 2 issues
	UnitTypePRs                        // 3 PRs
	UnitTypeCommits                    // 4 Commits
	UnitTypeReleases                   // 5 Releases
	UnitTypeWiki                       // 6 Wiki
	UnitTypeSettings                   // 7 Settings
	UnitTypeExternalWiki               // 8 ExternalWiki
	UnitTypeExternalTracker            // 9 ExternalTracker
)

Enumerate all the unit types

Variables

This section is empty.

Functions

func Migrate

func Migrate(x *xorm.Engine) error

Migrate database to current version

Types

type ExternalLoginUser added in v1.1.0

type ExternalLoginUser struct {
	ExternalID    string `xorm:"NOT NULL"`
	UserID        int64  `xorm:"NOT NULL"`
	LoginSourceID int64  `xorm:"NOT NULL"`
}

ExternalLoginUser makes the connecting between some existing user and additional external login sources

type Migration

type Migration interface {
	Description() string
	Migrate(*xorm.Engine) error
}

Migration describes on migration from lower version to high version

func NewMigration

func NewMigration(desc string, fn func(*xorm.Engine) error) Migration

NewMigration creates a new migration

type Repo added in v1.1.0

type Repo struct {
	ID                                                                               int64
	EnableWiki, EnableExternalWiki, EnableIssues, EnableExternalTracker, EnablePulls bool
	ExternalWikiURL, ExternalTrackerURL, ExternalTrackerFormat, ExternalTrackerStyle string
}

Repo describes a repository

type RepoUnit added in v1.1.0

type RepoUnit struct {
	ID          int64
	RepoID      int64 `xorm:"INDEX(s)"`
	Type        int   `xorm:"INDEX(s)"`
	Index       int
	Config      map[string]string `xorm:"JSON"`
	CreatedUnix int64             `xorm:"INDEX CREATED"`
	Created     time.Time         `xorm:"-"`
}

RepoUnit describes all units of a repository

type TAccessToken

type TAccessToken struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TAccessToken defines the struct for migrating table access_token

func (*TAccessToken) TableName

func (t *TAccessToken) TableName() string

TableName will be invoked by XORM to customrize the table name

type TAction

type TAction struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
}

TAction defines the struct for migrating table action

func (*TAction) TableName

func (t *TAction) TableName() string

TableName will be invoked by XORM to customrize the table name

type TAttachment

type TAttachment struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
}

TAttachment defines the struct for migrating table attachment

func (*TAttachment) TableName

func (t *TAttachment) TableName() string

TableName will be invoked by XORM to customrize the table name

type TComment

type TComment struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
}

TComment defines the struct for migrating table comment

func (*TComment) TableName

func (t *TComment) TableName() string

TableName will be invoked by XORM to customrize the table name

type TDeployKey

type TDeployKey struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TDeployKey defines the struct for migrating table deploy_key

func (*TDeployKey) TableName

func (t *TDeployKey) TableName() string

TableName will be invoked by XORM to customrize the table name

type TIssue

type TIssue struct {
	ID           int64 `xorm:"pk autoincr"`
	DeadlineUnix int64
	CreatedUnix  int64
	UpdatedUnix  int64
}

TIssue defines the struct for migrating table issue

func (*TIssue) TableName

func (t *TIssue) TableName() string

TableName will be invoked by XORM to customrize the table name

type TLoginSource

type TLoginSource struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TLoginSource defines the struct for migrating table login_source

func (*TLoginSource) TableName

func (t *TLoginSource) TableName() string

TableName will be invoked by XORM to customrize the table name

type TMilestone

type TMilestone struct {
	ID             int64 `xorm:"pk autoincr"`
	DeadlineUnix   int64
	ClosedDateUnix int64
}

TMilestone defines the struct for migrating table milestone

func (*TMilestone) TableName

func (t *TMilestone) TableName() string

TableName will be invoked by XORM to customrize the table name

type TMirror

type TMirror struct {
	ID             int64 `xorm:"pk autoincr"`
	UpdatedUnix    int64
	NextUpdateUnix int64
}

TMirror defines the struct for migrating table mirror

func (*TMirror) TableName

func (t *TMirror) TableName() string

TableName will be invoked by XORM to customrize the table name

type TNotice

type TNotice struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
}

TNotice defines the struct for migrating table notice

func (*TNotice) TableName

func (t *TNotice) TableName() string

TableName will be invoked by XORM to customrize the table name

type TPublicKey

type TPublicKey struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TPublicKey defines the struct for migrating table public_key

func (*TPublicKey) TableName

func (t *TPublicKey) TableName() string

TableName will be invoked by XORM to customrize the table name

type TPull

type TPull struct {
	ID         int64 `xorm:"pk autoincr"`
	MergedUnix int64
}

TPull defines the struct for migrating table pull_request

func (*TPull) TableName

func (t *TPull) TableName() string

TableName will be invoked by XORM to customrize the table name

type TRelease

type TRelease struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
}

TRelease defines the struct for migrating table release

func (*TRelease) TableName

func (t *TRelease) TableName() string

TableName will be invoked by XORM to customrize the table name

type TRepo

type TRepo struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TRepo defines the struct for migrating table repository

func (*TRepo) TableName

func (t *TRepo) TableName() string

TableName will be invoked by XORM to customrize the table name

type TUser

type TUser struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TUser defines the struct for migrating table user

func (*TUser) TableName

func (t *TUser) TableName() string

TableName will be invoked by XORM to customrize the table name

type TWebhook

type TWebhook struct {
	ID          int64 `xorm:"pk autoincr"`
	CreatedUnix int64
	UpdatedUnix int64
}

TWebhook defines the struct for migrating table webhook

func (*TWebhook) TableName

func (t *TWebhook) TableName() string

TableName will be invoked by XORM to customrize the table name

type UserV14 added in v1.0.0

type UserV14 struct {
	DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"`
}

UserV14 describes the added fields for migrating from v13 -> v14

func (*UserV14) TableName added in v1.0.0

func (*UserV14) TableName() string

TableName will be invoked by XORM to customrize the table name

type UserV15 added in v1.1.0

type UserV15 struct {
	AllowCreateOrganization bool
}

UserV15 describes the added field for User

func (*UserV15) TableName added in v1.1.0

func (*UserV15) TableName() string

TableName will be invoked by XORM to customrize the table name

type Version

type Version struct {
	ID      int64 `xorm:"pk autoincr"`
	Version int64
}

Version describes the version table. Should have only one row with id==1

Jump to

Keyboard shortcuts

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