Compare commits
No commits in common. "d5f0d3ee8c884386acccfd7f73f381aef91fde53" and "ef31399ab61cd9fea36232e30c08ee0e659484b7" have entirely different histories.
d5f0d3ee8c
...
ef31399ab6
@ -1,13 +0,0 @@
|
||||
-- +migrate Up
|
||||
ALTER TABLE "PostReference"
|
||||
ALTER COLUMN post_id TYPE CHAR(25),
|
||||
ALTER COLUMN source_id TYPE CHAR(25);
|
||||
|
||||
ALTER TABLE post_tags
|
||||
ALTER COLUMN post_id TYPE CHAR(25);
|
||||
|
||||
ALTER TABLE "UserFavorites"
|
||||
ALTER COLUMN post_id TYPE CHAR(25);
|
||||
|
||||
ALTER TABLE "UserSource"
|
||||
ALTER COLUMN source_id TYPE CHAR(25);
|
@ -9,10 +9,8 @@ const (
|
||||
|
||||
type Pool struct {
|
||||
BaseModel[PoolID]
|
||||
Name string `json:"name" gorm:"column:name;type:varchar(25)"`
|
||||
Category PoolCategory `json:"category" gorm:"column:category;type:pool_category;type:enum('series', 'collection')"`
|
||||
Posts []PoolPost `json:"posts" gorm:"foreignKey:PoolID"`
|
||||
Sources []PoolReference `json:"sources" gorm:"foreignKey:PoolID"`
|
||||
Name string `json:"name" gorm:"type:varchar(25)"`
|
||||
Category PoolCategory `json:"category" gorm:"type:pool_category;type:enum('series', 'collection')"`
|
||||
}
|
||||
|
||||
func (Pool) TableName() string {
|
||||
@ -20,10 +18,11 @@ func (Pool) TableName() string {
|
||||
}
|
||||
|
||||
type PoolPost struct {
|
||||
PoolID PoolID `json:"pool_id" gorm:"column:pool_id;primaryKey"`
|
||||
Pool Pool `json:"-"`
|
||||
PostID PostID `json:"post_id" gorm:"column:post_id;primaryKey"`
|
||||
OrderPosition int `json:"order_position" gorm:"column:order_position;default:0"`
|
||||
Pool Pool `json:"pool" gorm:"foreignKey:ID;references:PoolID"`
|
||||
PoolID PoolID `json:"pool_id" gorm:""`
|
||||
Post Post `json:"post" gorm:"foreignKey:ID;references:PostID"`
|
||||
PostID PostID `json:"post_id" gorm:""`
|
||||
OrderPosition int `json:"order_position" gorm:"not null;default:0"`
|
||||
}
|
||||
|
||||
func (PoolPost) TableName() string {
|
||||
@ -31,10 +30,11 @@ func (PoolPost) TableName() string {
|
||||
}
|
||||
|
||||
type PoolReference struct {
|
||||
PoolID PoolID `json:"pool_id" gorm:"column:pool_id;primaryKey"`
|
||||
Pool Pool `json:"-"`
|
||||
SourceID SourceID `json:"source_id" gorm:"column:source_id;primaryKey"`
|
||||
URL string `json:"url" gorm:"column:url;primaryKey"`
|
||||
Pool Pool `json:"pool" gorm:"foreignKey:ID;references:PoolID"`
|
||||
PoolID PoolID `json:"pool_id" gorm:""`
|
||||
Source Source `json:"source" gorm:"foreignKey:ID;references:SourceID"`
|
||||
SourceID SourceID `json:"source_id" gorm:""`
|
||||
URL string `json:"url" gorm:"not null"`
|
||||
}
|
||||
|
||||
func (PoolReference) TableName() string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user