mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-06-08 07:33:52 +02:00
remove migration for send as calendar, improve text for sending .ics
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user