mirror of
https://github.com/gabehf/Koito.git
synced 2026-03-10 16:00:36 -07:00
fix: set first artist listed as primary by default (#81)
This commit is contained in:
parent
cd31b6f2d8
commit
70f5198781
17 changed files with 46 additions and 26 deletions
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by sqlc. DO NOT EDIT.
|
||||
// versions:
|
||||
// sqlc v1.29.0
|
||||
// sqlc v1.30.0
|
||||
// source: release.sql
|
||||
|
||||
package repository
|
||||
|
|
@ -14,18 +14,19 @@ import (
|
|||
)
|
||||
|
||||
const associateArtistToRelease = `-- name: AssociateArtistToRelease :exec
|
||||
INSERT INTO artist_releases (artist_id, release_id)
|
||||
VALUES ($1, $2)
|
||||
INSERT INTO artist_releases (artist_id, release_id, is_primary)
|
||||
VALUES ($1, $2, $3)
|
||||
ON CONFLICT DO NOTHING
|
||||
`
|
||||
|
||||
type AssociateArtistToReleaseParams struct {
|
||||
ArtistID int32
|
||||
ReleaseID int32
|
||||
IsPrimary bool
|
||||
}
|
||||
|
||||
func (q *Queries) AssociateArtistToRelease(ctx context.Context, arg AssociateArtistToReleaseParams) error {
|
||||
_, err := q.db.Exec(ctx, associateArtistToRelease, arg.ArtistID, arg.ReleaseID)
|
||||
_, err := q.db.Exec(ctx, associateArtistToRelease, arg.ArtistID, arg.ReleaseID, arg.IsPrimary)
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue