basic usermanagement and various fixes
[smr.git] / gui / db / schema.rb
blob605fd2a518de450c8e3c12948743269031b80395
2 # This file is part of SMR.
4 # SMR is free software: you can redistribute it and/or modify it under the
5 # terms of the GNU General Public License as published by the Free Software
6 # Foundation, either version 3 of the License, or (at your option) any later
7 # version.
9 # SMR is distributed in the hope that it will be useful, but WITHOUT ANY
10 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along with
14 # SMR.  If not, see <http://www.gnu.org/licenses/>.
16 # This file is auto-generated from the current state of the database. Instead
17 # of editing this file, please use the migrations feature of Active Record to
18 # incrementally modify your database, and then regenerate this schema definition.
20 # Note that this schema.rb definition is the authoritative source for your
21 # database schema. If you need to create the application database on another
22 # system, you should be using db:schema:load, not running all the migrations
23 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
24 # you'll amass, the slower it'll run and the greater likelihood for issues).
26 # It's strongly recommended to check this file into your version control system.
28 ActiveRecord::Schema.define(:version => 0) do
30   create_table "access", :id => false, :force => true do |t|
31     t.integer "id_user",               :default => 0,  :null => false
32     t.string  "name",    :limit => 32, :default => "", :null => false
33     t.boolean "access"
34   end
36   create_table "comment", :force => true do |t|
37     t.integer "id_user",                     :null => false
38     t.integer "date",                        :null => false
39     t.string  "title",                       :null => false
40     t.text    "comment", :limit => 16777215
41   end
43   create_table "dividend", :force => true do |t|
44     t.integer "id_stock",                                :null => false
45     t.integer "date",                                    :null => false
46     t.float   "received", :limit => 10, :default => 0.0, :null => false
47   end
49   create_table "document", :force => true do |t|
50     t.integer "id_user",                   :null => false
51     t.string  "mimetype",    :limit => 50, :null => false
52     t.string  "filename",                  :null => false
53     t.integer "size",                      :null => false
54     t.integer "date_upload",               :null => false
55     t.text    "comment"
56   end
58   create_table "document_assign", :primary_key => "id_document", :force => true do |t|
59     t.integer "id_portfolio"
60     t.integer "id_position"
61     t.integer "id_order"
62     t.integer "id_stock"
63     t.boolean "is_assigned"
64   end
66   add_index "document_assign", ["id_document"], :name => "id_document", :unique => true
68   create_table "document_data", :primary_key => "id_document", :force => true do |t|
69     t.binary "content", :limit => 16777215, :null => false
70   end
72   add_index "document_data", ["id_document"], :name => "id_document", :unique => true
74   create_table "figure_data", :force => true do |t|
75     t.integer "id_figure_var",              :null => false
76     t.integer "id_stock",                   :null => false
77     t.integer "date",                       :null => false
78     t.string  "period",        :limit => 0, :null => false
79     t.string  "analyst"
80     t.float   "value",                      :null => false
81     t.boolean "is_expected"
82     t.boolean "is_audited"
83     t.text    "comment"
84   end
86   create_table "figure_var", :force => true do |t|
87     t.integer "id_user",                        :default => 0, :null => false
88     t.string  "name",                                          :null => false
89     t.string  "unit",       :limit => 3
90     t.text    "expression", :limit => 16777215
91     t.text    "comment"
92   end
94   create_table "news", :id => false, :force => true do |t|
95     t.integer "id_user",       :default => 0,     :null => false
96     t.integer "id_news_feed",  :default => 0,     :null => false
97     t.boolean "is_subscribed", :default => false, :null => false
98   end
100   create_table "news_assign", :id => false, :force => true do |t|
101     t.integer "id_news_item", :default => 0, :null => false
102     t.integer "id_position",  :default => 0, :null => false
103     t.boolean "is_assigned"
104   end
106   add_index "news_assign", ["id_news_item", "id_position"], :name => "NID", :unique => true
108   create_table "news_feed", :force => true do |t|
109     t.string  "url"
110     t.boolean "fetch_feed",                 :default => true
111     t.integer "last_fetched",               :default => 0
112     t.string  "title"
113     t.string  "link"
114     t.text    "description"
115     t.string  "language",     :limit => 10
116     t.integer "ttl"
117     t.string  "copyright"
118     t.integer "count_total",                                  :null => false
119   end
121   create_table "news_item", :force => true do |t|
122     t.integer "id_news_feed",                    :default => 0, :null => false
123     t.string  "identifier",                                     :null => false
124     t.string  "identifier_method", :limit => 0,                 :null => false
125     t.integer "fetched",                                        :null => false
126     t.string  "title"
127     t.string  "link"
128     t.text    "description"
129     t.string  "pubDate",           :limit => 50
130   end
132   #add_index "news_item", ["title", "description"], :name => "title"
134   create_table "news_read", :id => false, :force => true do |t|
135     t.integer "id_news_feed",  :null => false
136     t.integer "id_user",       :null => false
137     t.integer "lastread"
138     t.integer "count_notread", :null => false
139   end
141   create_table "order", :force => true do |t|
142     t.integer "id_position",                                         :null => false
143     t.integer "issued",                          :default => 0,      :null => false
144     t.integer "expire",                          :default => 0,      :null => false
145     t.string  "type",        :limit => 10,       :default => "buy",  :null => false
146     t.float   "shares",      :limit => 50,       :default => 0.0,    :null => false
147     t.float   "limit",       :limit => 50,       :default => 0.0,    :null => false
148     t.string  "addon",       :limit => 10,       :default => "none", :null => false
149     t.string  "exchange",    :limit => 25
150     t.float   "quote",       :limit => 50,       :default => 0.0,    :null => false
151     t.float   "provision"
152     t.float   "courtage"
153     t.float   "expense"
154     t.text    "comment",     :limit => 16777215
155     t.boolean "is_canceled"
156   end
158   create_table "portfolio", :force => true do |t|
159     t.integer "id_user",                                  :null => false
160     t.string  "name",                                     :null => false
161     t.string  "type",         :limit => 0,                :null => false
162     t.integer "date_created",                             :null => false
163     t.float   "taxallowance"
164     t.integer "order",        :limit => 1, :default => 0
165     t.text    "comment"
166   end
168   create_table "position", :force => true do |t|
169     t.integer "id_portfolio",                :null => false
170     t.integer "id_stock",                    :null => false
171     t.integer "closed",       :default => 0
172     t.text    "comment",                     :null => false
173   end
175   create_table "position_revision", :id => false, :force => true do |t|
176     t.integer "id_order",                                   :null => false
177     t.integer "id_position",                                :null => false
178     t.integer "date",                      :default => 0,   :null => false
179     t.float   "shares",      :limit => 50, :default => 0.0, :null => false
180     t.float   "invested",                  :default => 0.0, :null => false
181   end
183   create_table "quote", :force => true do |t|
184     t.integer "id_stock",               :default => 0,   :null => false
185     t.integer "date",                   :default => 0,   :null => false
186     t.float   "quote",    :limit => 25, :default => 0.0, :null => false
187     t.float   "low",      :limit => 25
188     t.float   "high",     :limit => 25
189     t.integer "volume"
190     t.string  "exchange", :limit => 50
191   end
193   create_table "quoterecord", :force => true do |t|
194     t.integer "id_user",                       :null => false
195     t.integer "id_stock",                      :null => false
196     t.integer "id_quote",                      :null => false
197     t.integer "created",                       :null => false
198     t.string  "column",           :limit => 0, :null => false
199     t.text    "comment"
200     t.boolean "is_pivotal_point"
201     t.boolean "is_signal"
202     t.boolean "is_uphit"
203     t.boolean "is_downhit"
204   end
206   create_table "quoterecord_rule", :force => true do |t|
207     t.integer "id_user",         :null => false
208     t.integer "last_modified"
209     t.integer "order"
210     t.string  "related_columns"
211     t.string  "name",            :null => false
212     t.text    "rule"
213   end
215   create_table "quoterecord_threshold", :id => false, :force => true do |t|
216     t.integer "id_user",                         :null => false
217     t.integer "id_stock",                        :null => false
218     t.float   "quote_sensitivity", :limit => 25
219     t.float   "hit_sensitivity",   :limit => 25
220   end
222   create_table "setting", :force => true do |t|
223     t.integer "id_user",               :default => 0,        :null => false
224     t.string  "type",    :limit => 10,  :default => "plugin", :null => false
225     t.string  "name",    :limit => 32
226     t.string  "var",     :limit => 32
227     t.string  "value"
228   end
230   create_table "split", :force => true do |t|
231     t.integer "id_stock",                     :null => false
232     t.integer "date",                         :null => false
233     t.string  "ratio",    :limit => 11,       :null => false
234     t.text    "comment",  :limit => 16777215
235   end
237   add_index "split", ["id_stock", "date"], :name => "SID", :unique => true
239   create_table "stock", :force => true do |t|
240     t.integer "id_stock_quotesource"
241     t.integer "id_stock_symbolextension"
242     t.boolean "fetch_quote",                            :default => true
243     t.string  "symbol",                   :limit => 32
244     t.string  "name",                                   :default => "--", :null => false
245     t.string  "url"
246     t.text    "comment"
247     t.date    "annual_meeting",                                           :null => false
248   end
250   create_table "stock_quotesource", :force => true do |t|
251     t.string "source"
252   end
254   create_table "stock_symbolextension", :force => true do |t|
255     t.string "extension", :null => false
256     t.string "fullname",  :null => false
257   end
259   create_table "timetag", :force => true do |t|
260     t.integer "id_user",     :null => false
261     t.string  "title",       :null => false
262     t.text    "description", :null => false
263     t.integer "start",       :null => false
264     t.integer "end",         :null => false
265   end
267   create_table "user", :force => true do |t|
268     t.string  "login",    :limit => 10,                          :null => false
269     t.boolean "is_admin",                     :default => false, :null => false
270     t.string  "fullname"
271     t.string  "email",    :limit => 50
272     t.text    "comment",  :limit => 16777215
273   end
275   create_table "version", :id => false, :force => true do |t|
276     t.integer "version", :limit => 1
277   end