fix of db table creation
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user