{"modulePath":"github.com/RedAFD/code-core","version":"v1.8.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package migrations\n\n## Constants\n\n```go\nconst (\n\tV16UnitTypeCode            = iota + 1 // 1 code\n\tV16UnitTypeIssues                     // 2 issues\n\tV16UnitTypePRs                        // 3 PRs\n\tV16UnitTypeCommits                    // 4 Commits\n\tV16UnitTypeReleases                   // 5 Releases\n\tV16UnitTypeWiki                       // 6 Wiki\n\tV16UnitTypeSettings                   // 7 Settings\n\tV16UnitTypeExternalWiki               // 8 ExternalWiki\n\tV16UnitTypeExternalTracker            // 9 ExternalTracker\n)\n```\nEnumerate all the unit types\n\n## Functions\n\n```go\nfunc Migrate(x *xorm.Engine) error\n```\nMigrate database to current version\n\n## Types\n\n```go\ntype CommitStatus struct {\n\tID          int64  `xorm:\"pk autoincr\"`\n\tIndex       int64  `xorm:\"INDEX UNIQUE(repo_sha_index)\"`\n\tRepoID      int64  `xorm:\"INDEX UNIQUE(repo_sha_index)\"`\n\tState       string `xorm:\"VARCHAR(7) NOT NULL\"`\n\tSHA         string `xorm:\"VARCHAR(64) NOT NULL INDEX UNIQUE(repo_sha_index)\"`\n\tTargetURL   string `xorm:\"TEXT\"`\n\tDescription string `xorm:\"TEXT\"`\n\tContext     string `xorm:\"TEXT\"`\n\tCreatorID   int64  `xorm:\"INDEX\"`\n\n\tCreatedUnix int64 `xorm:\"INDEX\"`\n\tUpdatedUnix int64 `xorm:\"INDEX\"`\n}\n```\nCommitStatus see models/status.go\n\n```go\ntype ExternalLoginUser struct {\n\tExternalID    string `xorm:\"NOT NULL\"`\n\tUserID        int64  `xorm:\"NOT NULL\"`\n\tLoginSourceID int64  `xorm:\"NOT NULL\"`\n}\n```\nExternalLoginUser makes the connecting between some existing user and additional external login sources\n\n```go\ntype Migration interface {\n\tDescription() string\n\tMigrate(*xorm.Engine) error\n}\n```\nMigration describes on migration from lower version to high version\n\n```go\nfunc NewMigration(desc string, fn func(*xorm.Engine) error) Migration\n```\nNewMigration creates a new migration\n\n```go\ntype ReleaseV39 struct {\n\tIsTag bool `xorm:\"NOT NULL DEFAULT false\"`\n}\n```\nReleaseV39 describes the added field for Release\n\n```go\nfunc (*ReleaseV39) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TAccessToken struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTAccessToken defines the struct for migrating table access\\_token\n\n```go\nfunc (t *TAccessToken) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TAction struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n}\n```\nTAction defines the struct for migrating table action\n\n```go\nfunc (t *TAction) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TAttachment struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n}\n```\nTAttachment defines the struct for migrating table attachment\n\n```go\nfunc (t *TAttachment) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TComment struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n}\n```\nTComment defines the struct for migrating table comment\n\n```go\nfunc (t *TComment) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TDeployKey struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTDeployKey defines the struct for migrating table deploy\\_key\n\n```go\nfunc (t *TDeployKey) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TIssue struct {\n\tID           int64 `xorm:\"pk autoincr\"`\n\tDeadlineUnix int64\n\tCreatedUnix  int64\n\tUpdatedUnix  int64\n}\n```\nTIssue defines the struct for migrating table issue\n\n```go\nfunc (t *TIssue) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TLoginSource struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTLoginSource defines the struct for migrating table login\\_source\n\n```go\nfunc (t *TLoginSource) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TMilestone struct {\n\tID             int64 `xorm:\"pk autoincr\"`\n\tDeadlineUnix   int64\n\tClosedDateUnix int64\n}\n```\nTMilestone defines the struct for migrating table milestone\n\n```go\nfunc (t *TMilestone) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TMirror struct {\n\tID             int64 `xorm:\"pk autoincr\"`\n\tUpdatedUnix    int64\n\tNextUpdateUnix int64\n}\n```\nTMirror defines the struct for migrating table mirror\n\n```go\nfunc (t *TMirror) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TNotice struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n}\n```\nTNotice defines the struct for migrating table notice\n\n```go\nfunc (t *TNotice) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TPublicKey struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTPublicKey defines the struct for migrating table public\\_key\n\n```go\nfunc (t *TPublicKey) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TPull struct {\n\tID         int64 `xorm:\"pk autoincr\"`\n\tMergedUnix int64\n}\n```\nTPull defines the struct for migrating table pull\\_request\n\n```go\nfunc (t *TPull) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TRelease struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n}\n```\nTRelease defines the struct for migrating table release\n\n```go\nfunc (t *TRelease) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TRepo struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTRepo defines the struct for migrating table repository\n\n```go\nfunc (t *TRepo) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TUser struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTUser defines the struct for migrating table user\n\n```go\nfunc (t *TUser) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype TWebhook struct {\n\tID          int64 `xorm:\"pk autoincr\"`\n\tCreatedUnix int64\n\tUpdatedUnix int64\n}\n```\nTWebhook defines the struct for migrating table webhook\n\n```go\nfunc (t *TWebhook) TableName() string\n```\nTableName will be invoked by XORM to customrize the table name\n\n```go\ntype Team struct {\n\tUnitTypes []int `xorm:\"json\"`\n}\n```\nTeam see models/team.go\n\n```go\ntype UserOpenID struct {\n\tID  int64  `xorm:\"pk autoincr\"`\n\tUID int64  `xorm:\"INDEX NOT NULL\"`\n\tURI string `xorm:\"UNIQUE NOT NULL\"`\n}\n```\nUserOpenID is the list of all OpenID identities of a user.\n\n```go\ntype UserV14 struct {\n\tDiffViewStyle string `xorm:\"NOT NULL DEFAULT ''\"`\n}\n```\nUserV14 describes the added fields for migrating from v13 -\u003e v14\n\n```go\nfunc (*UserV14) TableName() string\n```\nTableName will be invoked by XORM to customize the table name\n\n```go\ntype Version struct {\n\tID      int64 `xorm:\"pk autoincr\"`\n\tVersion int64\n}\n```\nVersion describes the version table. Should have only one row with id==1\n\n","path":"github.com/RedAFD/code-core/models/migrations","name":"migrations","synopsis":"","isRedistributable":true}
