migrations

package
v0.0.0-...-2e80238 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL