diff --git a/Portifolio b/Portifolio index 9a61511..c438cbf 100755 Binary files a/Portifolio and b/Portifolio differ diff --git a/app.db b/app.db index 46399b2..44df43f 100644 Binary files a/app.db and b/app.db differ diff --git a/internal/database/main.go b/internal/database/main.go index 33f6798..de52136 100644 --- a/internal/database/main.go +++ b/internal/database/main.go @@ -82,7 +82,7 @@ func InitDB(db *sql.DB) { ); -- parent table - CREATE TABLE closed_positions ( + CREATE TABLE IF NOT EXISTS closed_positions ( id INTEGER PRIMARY KEY AUTOINCREMENT, symbol TEXT NOT NULL, currency_code TEXT NOT NULL, @@ -94,7 +94,7 @@ func InitDB(db *sql.DB) { ); -- child table, one row per close lot - CREATE TABLE close_entries ( + CREATE TABLE IF NOT EXISTS close_entries ( id INTEGER PRIMARY KEY AUTOINCREMENT, closed_position_id INTEGER NOT NULL REFERENCES closed_positions(id), shares INTEGER NOT NULL,