Feat: add more tests
This commit is contained in:
@@ -154,7 +154,7 @@ func (self *BunDatabase) GetImages(
|
||||
if len(imageIds) > 0 {
|
||||
err := self.db.NewSelect().
|
||||
Model(&ret).
|
||||
Where("image_id IN (?)", bun.In(imageIds)).
|
||||
Where("id IN (?)", bun.In(imageIds)).
|
||||
Relation("Aliases").
|
||||
Scan(ctx)
|
||||
if err != nil {
|
||||
@@ -178,7 +178,7 @@ func (self *BunDatabase) UpdateAliases(
|
||||
}
|
||||
_, err := self.db.NewInsert().
|
||||
Model(&aliases).
|
||||
On("CONFLICT (id) DO NOTHING").
|
||||
On("CONFLICT (name) DO NOTHING").
|
||||
Exec(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -193,7 +193,7 @@ func (self *BunDatabase) UpdateAliases(
|
||||
}
|
||||
_, err = self.db.NewInsert().
|
||||
Model(&rels).
|
||||
On("CONFLICT (alias_id, image_id) DO NOTHING").
|
||||
On(`CONFLICT ("alias_id", "image_id") DO NOTHING`).
|
||||
Exec(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user