Documentation
¶
Index ¶
- func ExpectedVersion() int64
- func GetCurrentDBVersion(engine *xorm.Engine) (int64, error)
- func InitDB(dataConf *data.Database) (err error)
- func Migrate(dbConf *data.Database, cacheConf *data.CacheConf, ...) error
- func UpdateInstallInfo(dataConf *data.Database, language string, siteName string, siteURL string, ...) error
- type Migration
- type QuestionPostTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentDBVersion ¶
GetCurrentDBVersion returns the current db version
func Migrate ¶
func Migrate(dbConf *data.Database, cacheConf *data.CacheConf, upgradeToSpecificVersion string) error
Migrate database to current version
func UpdateInstallInfo ¶ added in v0.3.0
func UpdateInstallInfo(dataConf *data.Database, language string, siteName string, siteURL string, contactEmail string, adminName string, adminPassword string, adminEmail string) error
UpdateInstallInfo update some init data about the admin interface and admin password
Types ¶
type Migration ¶
type Migration interface {
Version() string
Description() string
Migrate(*xorm.Engine) error
ShouldCleanCache() bool
}
Migration describes on migration from lower version to high version
type QuestionPostTime ¶ added in v1.1.0
type QuestionPostTime struct {
ID string `xorm:"not null pk BIGINT(20) id"`
CreatedAt time.Time `xorm:"not null default CURRENT_TIMESTAMP TIMESTAMP created_at"`
UpdatedAt time.Time `xorm:"updated_at TIMESTAMP"`
UserID string `xorm:"not null default 0 BIGINT(20) INDEX user_id"`
LastEditUserID string `xorm:"not null default 0 BIGINT(20) last_edit_user_id"`
Title string `xorm:"not null default '' VARCHAR(150) title"`
OriginalText string `xorm:"not null MEDIUMTEXT original_text"`
ParsedText string `xorm:"not null MEDIUMTEXT parsed_text"`
Status int `xorm:"not null default 1 INT(11) status"`
Pin int `xorm:"not null default 1 INT(11) pin"`
Show int `xorm:"not null default 1 INT(11) show"`
ViewCount int `xorm:"not null default 0 INT(11) view_count"`
UniqueViewCount int `xorm:"not null default 0 INT(11) unique_view_count"`
VoteCount int `xorm:"not null default 0 INT(11) vote_count"`
AnswerCount int `xorm:"not null default 0 INT(11) answer_count"`
CollectionCount int `xorm:"not null default 0 INT(11) collection_count"`
FollowCount int `xorm:"not null default 0 INT(11) follow_count"`
AcceptedAnswerID string `xorm:"not null default 0 BIGINT(20) accepted_answer_id"`
LastAnswerID string `xorm:"not null default 0 BIGINT(20) last_answer_id"`
PostUpdateTime time.Time `xorm:"post_update_time TIMESTAMP"`
RevisionID string `xorm:"not null default 0 BIGINT(20) revision_id"`
}
func (QuestionPostTime) TableName ¶ added in v1.1.0
func (QuestionPostTime) TableName() string
Click to show internal directories.
Click to hide internal directories.