Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Up_01_create_stocks = []string{
`CREATE TABLE stocks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name VARCHAR(20) NOT NULL UNIQUE COLLATE NOCASE,
last_quote DOUBLE,
last_quote_date DATETIME
);`,
}
View Source
var Up_02_create_entries = []string{
`CREATE TABLE entries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
stock_id INTEGER NOT NULL,
unit_price DOUBLE NOT NULL,
quantity INTEGER NOT NULL,
created_at DATETIME NOT NULL,
FOREIGN KEY (stock_id) REFERENCES stocks(id)
);`,
}
View Source
var Up_03_create_reports = []string{
`CREATE TABLE reports (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_at DATETIME NOT NULL,
diff_of_last_report DOUBLE,
diff_of_last_month DOUBLE
);`,
`CREATE INDEX idx_reports_created_at ON reports (created_at);`,
}
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.