fix of db table creation

This commit is contained in:
zipfriis
2026-04-09 13:19:35 +02:00
parent 430127c0f1
commit 1e64e45491
3 changed files with 2 additions and 2 deletions

Binary file not shown.

BIN
app.db

Binary file not shown.

View File

@@ -82,7 +82,7 @@ func InitDB(db *sql.DB) {
); );
-- parent table -- parent table
CREATE TABLE closed_positions ( CREATE TABLE IF NOT EXISTS closed_positions (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
symbol TEXT NOT NULL, symbol TEXT NOT NULL,
currency_code TEXT NOT NULL, currency_code TEXT NOT NULL,
@@ -94,7 +94,7 @@ func InitDB(db *sql.DB) {
); );
-- child table, one row per close lot -- child table, one row per close lot
CREATE TABLE close_entries ( CREATE TABLE IF NOT EXISTS close_entries (
id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER PRIMARY KEY AUTOINCREMENT,
closed_position_id INTEGER NOT NULL REFERENCES closed_positions(id), closed_position_id INTEGER NOT NULL REFERENCES closed_positions(id),
shares INTEGER NOT NULL, shares INTEGER NOT NULL,