Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita21431a

Browse files
authored
fix: Increase size of TrailerSource and ExternalData (#1658)
1 parentb7de0cc commita21431a

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

‎pkg/migrations/migrations.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,19 @@ func Migrate() {
804804
returntx.AutoMigrate(ExternalReference{}).Error
805805
},
806806
},
807+
{
808+
ID:"0077-trailer-source-and-external-data-size-change",
809+
Migrate:func(tx*gorm.DB)error {
810+
ifmodels.GetDBConn().Driver=="mysql" {
811+
err:=tx.Debug().Model(&models.Scene{}).ModifyColumn("trailer_source","longtext").Error
812+
iferr!=nil {
813+
returnerr
814+
}
815+
returntx.Model(&models.ExternalReference{}).ModifyColumn("external_data","longtext").Error
816+
}
817+
returnnil
818+
},
819+
},
807820

808821
// ===============================================================================================
809822
// Put DB Schema migrations above this line and migrations that rely on the updated schema below

‎pkg/models/model_external_reference.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type ExternalReference struct {
2626
ExternalIdstring`json:"external_id" gorm:"index" xbvrbackup:"external_id"`
2727
ExternalURLstring`json:"external_url" gorm:"size:1000" xbvrbackup:"external_url"`
2828
ExternalDate time.Time`json:"external_date" xbvrbackup:"external_date"`
29-
ExternalDatastring`json:"external_data" sql:"type:text;" xbvrbackup:"external_data"`
29+
ExternalDatastring`json:"external_data" sql:"type:longtext;" xbvrbackup:"external_data"`
3030
UdfBool1bool`json:"udf_bool1" xbvrbackup:"udf_bool1"`// user defined fields, use depends what type of data the extref is for.
3131
UdfBool2bool`json:"udf_bool2" xbvrbackup:"udf_bool2"`
3232
UdfDatetime1 time.Time`json:"udf_datetime1" xbvrbackup:"udf_datetime1"`

‎pkg/models/model_scene.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ type Scene struct {
101101
NeedsUpdatebool`json:"needs_update" xbvrbackup:"-"`
102102
EditsAppliedbool`json:"edits_applied" gorm:"default:false" xbvrbackup:"-"`
103103
TrailerTypestring`json:"trailer_type" xbvrbackup:"trailer_type"`
104-
TrailerSourcestring`gorm:"size:1000" json:"trailer_source" xbvrbackup:"trailer_source"`
104+
TrailerSourcestring`json:"trailer_source" sql:"type:longtext;" xbvrbackup:"trailer_source"`
105105
ChromaKeystring`json:"passthrough" xbvrbackup:"passthrough"`
106106
Trailerlistbool`json:"trailerlist" gorm:"default:false" xbvrbackup:"trailerlist"`
107107
IsSubscribedbool`json:"is_subscribed" gorm:"default:false"`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp