Add names to link shares
This commit is contained in:
parent
0b8173c1c3
commit
44ea584ffe
43
pkg/migration/20210403220653.go
Normal file
43
pkg/migration/20210403220653.go
Normal file
@ -0,0 +1,43 @@
|
||||
// Vikunja is a to-do list application to facilitate your life.
|
||||
// Copyright 2018-2021 Vikunja and contributors. All rights reserved.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public Licensee as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public Licensee for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public Licensee
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package migration
|
||||
|
||||
import (
|
||||
"src.techknowlogick.com/xormigrate"
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
type linkShares20210403220653 struct {
|
||||
Name string `xorm:"text null" json:"name"`
|
||||
}
|
||||
|
||||
func (linkShares20210403220653) TableName() string {
|
||||
return "link_shares"
|
||||
}
|
||||
|
||||
func init() {
|
||||
migrations = append(migrations, &xormigrate.Migration{
|
||||
ID: "20210403220653",
|
||||
Description: "Add the name column to link shares",
|
||||
Migrate: func(tx *xorm.Engine) error {
|
||||
return tx.Sync2(linkShares20210403220653{})
|
||||
},
|
||||
Rollback: func(tx *xorm.Engine) error {
|
||||
return nil
|
||||
},
|
||||
})
|
||||
}
|
@ -42,6 +42,8 @@ type LinkSharing struct {
|
||||
ID int64 `xorm:"bigint autoincr not null unique pk" json:"id" param:"share"`
|
||||
// The public id to get this shared list
|
||||
Hash string `xorm:"varchar(40) not null unique" json:"hash" param:"hash"`
|
||||
// The name of this link share. All actions someone takes while being authenticated with that link will appear with that name.
|
||||
Name string `xorm:"text null" json:"name"`
|
||||
// The ID of the shared list
|
||||
ListID int64 `xorm:"bigint not null" json:"-" param:"list"`
|
||||
// The right this list is shared with. 0 = Read only, 1 = Read & Write, 2 = Admin. See the docs for more details.
|
||||
|
Loading…
x
Reference in New Issue
Block a user