From 75b8d72dd6c17582a77575e4a3e4a7abb6ffcce7 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 28 Jul 2020 08:23:50 +0100 Subject: removed UNIQUE which didnt make sense after consideration --- pkg/datamaps/db.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/datamaps/db.go b/pkg/datamaps/db.go index 2d675a6..30ebd6a 100644 --- a/pkg/datamaps/db.go +++ b/pkg/datamaps/db.go @@ -38,8 +38,7 @@ func setupDB(path string) (*sql.DB, error) { CREATE TABLE return( id INTEGER PRIMARY KEY, name TEXT, - date_created TEXT, - UNIQUE(name) + date_created TEXT ); CREATE TABLE return_data( @@ -185,7 +184,7 @@ func importXLSXtoDB(dm_name string, return_name string, file string, db *sql.DB) res, err := stmtReturn.Exec(return_name, time.Now()) if err != nil { - err := fmt.Errorf("%v\nReturn '%s' already in database. Use a different name.", err, return_name) + err := fmt.Errorf("%v\nCannot create %s", err, return_name) fmt.Println(err.Error()) os.Exit(1) } -- cgit v1.2.3