gitea: code.gitea.io/gitea/models/migrations Index | Files

package migrations

import "code.gitea.io/gitea/models/migrations"

Index

Package Files

migrations.go v100.go v101.go v102.go v103.go v104.go v105.go v106.go v107.go v108.go v109.go v110.go v111.go v112.go v113.go v114.go v115.go v116.go v117.go v118.go v119.go v120.go v121.go v122.go v123.go v124.go v125.go v126.go v127.go v128.go v129.go v130.go v131.go v132.go v133.go v134.go v135.go v136.go v137.go v138.go v139.go v140.go v141.go v142.go v143.go v144.go v145.go v146.go v147.go v148.go v149.go v150.go v151.go v152.go v153.go v154.go v155.go v156.go v157.go v158.go v159.go v160.go v161.go v162.go v163.go v164.go v165.go v166.go v70.go v71.go v72.go v73.go v74.go v75.go v76.go v77.go v78.go v79.go v80.go v81.go v82.go v83.go v84.go v85.go v86.go v87.go v88.go v89.go v90.go v91.go v92.go v93.go v94.go v95.go v96.go v97.go v98.go v99.go

func EnsureUpToDate Uses

func EnsureUpToDate(x *xorm.Engine) error

EnsureUpToDate will check if the db is at the correct version

func ExpectedVersion Uses

func ExpectedVersion() int64

ExpectedVersion returns the expected db version

func GetCurrentDBVersion Uses

func GetCurrentDBVersion(x *xorm.Engine) (int64, error)

GetCurrentDBVersion returns the current db version

func Migrate Uses

func Migrate(x *xorm.Engine) error

Migrate database to current version

func RecreateTables Uses

func RecreateTables(beans ...interface{}) func(*xorm.Engine) error

RecreateTables will recreate the tables for the provided beans using the newly provided bean definition and move all data to that new table WARNING: YOU MUST PROVIDE THE FULL BEAN DEFINITION

type Migration Uses

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

Migration describes on migration from lower version to high version

func NewMigration Uses

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

NewMigration creates a new migration

type OAuth2Grant Uses

type OAuth2Grant struct {
    ID            int64  `xorm:"pk autoincr"`
    UserID        int64  `xorm:"INDEX unique(user_application)"`
    ApplicationID int64  `xorm:"INDEX unique(user_application)"`
    Counter       int64  `xorm:"NOT NULL DEFAULT 1"`
    Scope         string `xorm:"TEXT"`
    Nonce         string `xorm:"TEXT"`
    CreatedUnix   int64  `xorm:"created"`
    UpdatedUnix   int64  `xorm:"updated"`
}

OAuth2Grant here is a snapshot of models.OAuth2Grant for this version of the database, as it does not appear to have been added as a part of a previous migration.

func (*OAuth2Grant) TableName Uses

func (grant *OAuth2Grant) TableName() string

TableName sets the database table name to be the correct one, as the autogenerated table name for this struct is "o_auth2_grant".

type RepoWatchMode Uses

type RepoWatchMode int8

RepoWatchMode specifies what kind of watch the user has on a repository

type Version Uses

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

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

type Watch Uses

type Watch struct {
    ID   int64         `xorm:"pk autoincr"`
    Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"`
}

Watch is connection request for receiving repository notification.

Package migrations imports 29 packages (graph) and is imported by 33 packages. Updated 2021-01-22. Refresh now. Tools for package owners.