Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tank
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
tank
Commits
f36bb388
Commit
f36bb388
authored
5 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
added playout-mode to playlist
parent
4f52c260
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
store/migrations.go
+30
-0
30 additions, 0 deletions
store/migrations.go
store/types.go
+1
-0
1 addition, 0 deletions
store/types.go
with
31 additions
and
0 deletions
store/migrations.go
+
30
−
0
View file @
f36bb388
...
@@ -144,6 +144,36 @@ var (
...
@@ -144,6 +144,36 @@ var (
return
nil
return
nil
},
},
},
},
{
ID
:
"201908110945"
,
Migrate
:
func
(
tx
*
gorm
.
DB
)
error
{
type
PlaylistEntry
struct
{
ID
uint64
`json:"-" gorm:"primary_key"`
PlaylistID
uint64
`json:"-" gorm:"not null;index;unique_index:unique_playlist_line_numbers"`
LineNum
uint
`json:"-" gorm:"not null;unique_index:unique_playlist_line_numbers"`
URI
string
`json:"uri" gorm:"size:1024"`
File
*
File
`json:"file,omitempty" gorm:"association_autoupdate:false;association_autocreate:false"`
FileID
*
uint64
`json:"-" gorm:"index"`
}
type
Playlist
struct
{
ID
uint64
`json:"id" gorm:"primary_key"`
CreatedAt
time
.
Time
`json:"created"`
UpdatedAt
time
.
Time
`json:"updated"`
Description
string
`json:"description"`
PlayoutMode
string
`json:"playout-mode"`
ShowName
string
`json:"show" gorm:"not null;index"`
Show
Show
`json:"-" gorm:"association_foreignkey:Name"`
Entries
[]
PlaylistEntry
`json:"entries,omitempty"`
}
return
tx
.
AutoMigrate
(
&
Playlist
{})
.
Error
},
Rollback
:
func
(
tx
*
gorm
.
DB
)
error
{
return
tx
.
Table
(
"playlists"
)
.
DropColumn
(
"playout_mode"
)
.
Error
},
},
}
}
)
)
...
...
This diff is collapsed.
Click to expand it.
store/types.go
+
1
−
0
View file @
f36bb388
...
@@ -210,6 +210,7 @@ type Playlist struct {
...
@@ -210,6 +210,7 @@ type Playlist struct {
CreatedAt
time
.
Time
`json:"created"`
CreatedAt
time
.
Time
`json:"created"`
UpdatedAt
time
.
Time
`json:"updated"`
UpdatedAt
time
.
Time
`json:"updated"`
Description
string
`json:"description"`
Description
string
`json:"description"`
PlayoutMode
string
`json:"playout-mode" gorm:"not null;default:'linear'"`
ShowName
string
`json:"show" gorm:"not null;index"`
ShowName
string
`json:"show" gorm:"not null;index"`
Show
Show
`json:"-" gorm:"association_foreignkey:Name"`
Show
Show
`json:"-" gorm:"association_foreignkey:Name"`
Entries
[]
PlaylistEntry
`json:"entries,omitempty"`
Entries
[]
PlaylistEntry
`json:"entries,omitempty"`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment