remove migration for send as calendar, improve text for sending .ics

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-06-06 09:29:25 +02:00
parent 432d3d2c74
commit a64eccf6d7
2 changed files with 1 additions and 18 deletions
+1 -3
View File
@@ -26,9 +26,7 @@ type Attachment struct {
Description string `gorm:";"`
Filename string `gorm:"not null;index"`
EmbeddedContent bool `gorm:"not null;default:false;index"`
// SendAsCalendar sends an ics file as a text/calendar; method=REQUEST
// alternative part so Outlook and Exchange Online render it as a native
// calendar invitation instead of a plain attachment
// SendAsCalendar sends ics files as a calendar invitation
SendAsCalendar bool `gorm:"not null;default:false;index"`
}
-15
View File
@@ -468,21 +468,6 @@ func migrate(db *gorm.DB) error {
return errs.Wrap(err)
}
// migration for attachments.send_as_calendar
// first add column as nullable
if err := db.Exec(`ALTER TABLE attachments ADD COLUMN send_as_calendar BOOLEAN`).Error; err != nil {
// column might already exist, ignore error
errMsg := strings.ToLower(err.Error())
if !strings.Contains(errMsg, "duplicate") && !strings.Contains(errMsg, "already exists") {
return errs.Wrap(err)
}
}
// update existing rows
if err := db.Exec(`UPDATE attachments SET send_as_calendar = false WHERE send_as_calendar IS NULL`).Error; err != nil {
return errs.Wrap(err)
}
// migration for email_attachments.is_inline
// first add column as nullable
if err := db.Exec(`ALTER TABLE email_attachments ADD COLUMN is_inline BOOLEAN`).Error; err != nil {