File: beancounter_schema_sqlite.txt

package info (click to toggle)
beancounter 0.8.8
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 360 kB
  • ctags: 142
  • sloc: perl: 2,592; sh: 744; makefile: 144
file content (72 lines) | stat: -rw-r--r-- 2,401 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
create table beancounter (
	    version		varchar(12) not null,
   	    data_last_updated	timestamp with time zone
	);
create table cash (
	    name 		varchar(16) not null default '',
	    value 		float default null,
	    currency 		varchar(12) default null,
	    type 		varchar(12) default null,
	    owner 		varchar(16) default NULL,
	    cost 		float default NULL,
	    date 		date default NULL
	);
create table fxprices (
	    currency   		varchar(12) not null default '',
	    date		date default null,
	    previous_close	float4 default null,
	    day_open		float4 default null,
	    day_low		float4 default null,
	    day_high		float4 default null,
	    day_close		float4 default null,
	    day_change		float4 default null
	);
create table indices (
	    symbol   		varchar(12) not null default '',
	    stockindex		varchar(12) not null default ''
	);
create table portfolio (
	    symbol   		varchar(16) not null default '',
	    shares		float4 default null,
	    currency		varchar(12) default null,
	    type		varchar(16) default null,
	    owner		varchar(16) default null,
	    cost		float(4) default null,
	    date		date default null
	);
create table stockinfo (
	    symbol   		varchar(12) not null default '',
	    name     		varchar(64) not null default '',
	    exchange 		varchar(16) not null default '',
	    capitalisation  	float4 default null,
	    low_52weeks		float4 default null,
	    high_52weeks	float4 default null,
	    earnings		float4 default null,
	    dividend		float4 default null,
	    p_e_ratio		float4 default null,
	    avg_volume		int4 default null,
	    active		boolean default TRUE
	);
create table stockprices (
	    symbol   		varchar(12) not null default '',
	    date		date default null,
	    previous_close	float4 default null,
	    day_open		float4 default null,
	    day_low		float4 default null,
	    day_high		float4 default null,
	    day_close		float4 default null,
	    day_change		float4 default null,
	    bid			float4 default null,
	    ask			float4 default null,
	    volume		int4 default null
	);
create unique index cash_pkey 
	    on cash (name,type,owner,date);
create unique index fxprices_pkey
	    on fxprices (currency, date);
create unique index portfolio_pkey
	    on portfolio (symbol, owner, date);
create unique index stockinfo_pkey
	    on stockinfo (symbol);
create unique index stockprices_pkey
	    on stockprices (symbol, date);