fix of db table creation
This commit is contained in:
BIN
Portifolio
BIN
Portifolio
Binary file not shown.
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user