chore: fix create shortcut view activity

This commit is contained in:
Steven
2023-12-24 00:22:03 +08:00
parent 546d87ca0b
commit 9259a85e69
12 changed files with 282 additions and 195 deletions

View File

@ -44,7 +44,7 @@ func (d *DB) ListActivities(ctx context.Context, find *store.FindActivity) ([]*s
where, args = append(where, "level = "+placeholder(len(args)+1)), append(args, find.Level.String())
}
if find.PayloadShortcutID != nil {
where, args = append(where, fmt.Sprintf("CAST(payload as JSON)->>'shortcutId' = %s", placeholder(len(args)+1))), append(args, *find.PayloadShortcutID)
where, args = append(where, fmt.Sprintf("CAST(payload::JSON->>'shortcutId' AS INTEGER) = %s", placeholder(len(args)+1))), append(args, *find.PayloadShortcutID)
}
query := `

View File

@ -57,8 +57,6 @@ func (d *DB) nonProdMigrate(ctx context.Context) error {
return nil
}
println("no tables in the database. start migration")
buf, err := migrationFS.ReadFile("migration/dev/" + latestSchemaFileName)
if err != nil {
return errors.Errorf("failed to read latest schema file: %s", err)