Fix sql statements

This commit is contained in:
Denis Makogon
2017-09-12 20:42:52 +03:00
parent bdb7e7fd7b
commit 0b47c8c40c

View File

@@ -227,7 +227,17 @@ func (ds *sqlStore) RemoveApp(ctx context.Context, appName string) error {
return models.ErrAppsNotFound return models.ErrAppsNotFound
} }
_, err = ds.db.ExecContext(ctx, ds.db.Rebind( _, err = ds.db.ExecContext(ctx, ds.db.Rebind(
`DELETE FROM routes, calls, logs WHERE app_name=?`), appName) `DELETE FROM logs WHERE app_name=?`), appName)
if err != nil {
return err
}
_, err = ds.db.ExecContext(ctx, ds.db.Rebind(
`DELETE FROM calls WHERE app_name=?`), appName)
if err != nil {
return err
}
_, err = ds.db.ExecContext(ctx, ds.db.Rebind(
`DELETE FROM routes WHERE app_name=?`), appName)
if err != nil { if err != nil {
return err return err
} }