writing pseudocode algorithm for data migration.

pull/224/head
Jason Kulatunga 3 years ago
parent 2750ccef4a
commit 7d963c96a6

@ -63,12 +63,22 @@ func (sr *scrutinyRepository) Migrate(ctx context.Context) error {
} }
//TODO: migrate the data from GORM to influxdb. //TODO: migrate the data from GORM to influxdb.
//get a list of all devices:
// get a list of all smart scans in the last 2 weeks:
// get a list of associated smart attribute data:
// translate to a collector.SmartInfo object
// call scrutinyRepository.SaveSmartAttributes
// get a list of all smart scans in the last 9 weeks:
// do same as above (select 1 scan per week)
// get a list of all smart scans in the last 25 months:
// do same as above (select 1 scan per month)
// get a list of all smart scans:
// do same as above (select 1 scan per year)
return nil return nil
}, },
}, },
//{ //{
// ID: "20220503120000", // v0.4.0 - influxdb schema // ID: "20220503120000", // cleanup - v0.4.0 - influxdb schema
// Migrate: func(tx *gorm.DB) error { // Migrate: func(tx *gorm.DB) error {
// // delete unnecessary tables. // // delete unnecessary tables.
// err := tx.Migrator().DropTable( // err := tx.Migrator().DropTable(

Loading…
Cancel
Save