fleet/server/datastore/mysql/migrations/tables/20210723135713_AddVulnerabilityDatabasesPath.go
Tomas Touceda 46b0b7765b
Issue 1435 software to cpe (#1488)
* WIP

* WIP

* Make path optional and fix tests

* Add first generate

* Move to nvd package

* remove replace

* Re-add replace

* It's path, not file name

* Change how db path is set and use etag

* Fix typos

* Make db generation faster

* Remove quotes

* Doesn't like comments

* Samitize etag and save to file

* Refactor some things and improve writing of etagenv

* Compress file and truncate amount of items for faster testing

* Remove quotes

* Try to improve performance

* Ignore truncate error if not exists

* Minor cleanup and make sqlite have cpe prefix

* Simplify code and test sync

* Add VCR for sync test

* Check for nvdRelease nil

* Add test for the actual translation

* Address review comments

* Rename generate command because we'll have a cve one too

* Move to its own dir

* Address review comments
2021-07-29 13:10:34 -03:00

22 lines
454 B
Go

package tables
import (
"database/sql"
"github.com/pkg/errors"
)
func init() {
MigrationClient.AddMigration(Up_20210723135713, Down_20210723135713)
}
func Up_20210723135713(tx *sql.Tx) error {
if _, err := tx.Exec(`ALTER TABLE app_configs ADD COLUMN vulnerability_databases_path TEXT`); err != nil {
return errors.Wrap(err, "add column vulnerability_databases_path")
}
return nil
}
func Down_20210723135713(tx *sql.Tx) error {
return nil
}