diff --git a/pkg/migration/20210403220653.go b/pkg/migration/20210403220653.go new file mode 100644 index 000000000..1ce91a4a3 --- /dev/null +++ b/pkg/migration/20210403220653.go @@ -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 . + +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 + }, + }) +} diff --git a/pkg/models/link_sharing.go b/pkg/models/link_sharing.go index 487d78fff..b907d3c6f 100644 --- a/pkg/models/link_sharing.go +++ b/pkg/models/link_sharing.go @@ -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.