Exemplo n.º 1
0
// Update the database with row(s) recording what we have done
func writeMetadata(config map[string]string, migrations []string) {

	for _, m := range migrations {
		sql := "Insert into fragmenta_metadata(updated_at,fragmenta_version,migration_version,status) VALUES(NOW(),$1,$2,100);"
		result, err := query.ExecSQL(sql, fragmentaVersion, m)
		if err != nil {
			log.Printf("Database ERROR %s %s", err, result)
		}
	}

}
Exemplo n.º 2
0
// Update the database with a line recording what we have done
func writeMetadata(config map[string]string, migrations []string) {
	// Try opening the db (db may not exist at this stage)
	err := openDatabase(config)
	if err != nil {
		log.Printf("Database ERROR %s", err)
	}
	defer query.CloseDatabase()

	for _, m := range migrations {
		sql := "Insert into fragmenta_metadata(updated_at,fragmenta_version,migration_version,status) VALUES(NOW(),$1,$2,100);"
		result, err := query.ExecSQL(sql, fragmentaVersion, m)
		if err != nil {
			log.Printf("Database ERROR %s %s", err, result)
		}
	}

}