schema.rb 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840
  1. # encoding: UTF-8
  2. # This file is auto-generated from the current state of the database. Instead
  3. # of editing this file, please use the migrations feature of Active Record to
  4. # incrementally modify your database, and then regenerate this schema definition.
  5. #
  6. # Note that this schema.rb definition is the authoritative source for your
  7. # database schema. If you need to create the application database on another
  8. # system, you should be using db:schema:load, not running all the migrations
  9. # from scratch. The latter is a flawed and unsustainable approach (the more migrations
  10. # you'll amass, the slower it'll run and the greater likelihood for issues).
  11. #
  12. # It's strongly recommended to check this file into your version control system.
  13. ActiveRecord::Schema.define(:version => 20160923193100) do
  14. create_table "accounts", :force => true do |t|
  15. t.string "name"
  16. t.string "email"
  17. t.string "password_digest"
  18. t.string "account_number"
  19. t.string "company"
  20. t.string "first_name"
  21. t.string "last_name"
  22. t.string "phone"
  23. t.string "contact2"
  24. t.string "contact3"
  25. t.string "contact4"
  26. t.datetime "created_at", :null => false
  27. t.datetime "updated_at", :null => false
  28. t.string "remember_token"
  29. t.boolean "is_admin"
  30. t.string "time_zone", :default => "UTC"
  31. end
  32. add_index "accounts", ["remember_token"], :name => "index_accounts_on_remember_token"
  33. create_table "create_reports", :force => true do |t|
  34. t.string "name"
  35. t.string "description"
  36. t.string "request_id"
  37. t.integer "ven_id"
  38. t.datetime "created_at", :null => false
  39. t.datetime "updated_at", :null => false
  40. t.boolean "active"
  41. t.boolean "create_queued"
  42. t.boolean "cancel_queued"
  43. end
  44. create_table "currency_types", :force => true do |t|
  45. t.string "name"
  46. t.string "description"
  47. t.datetime "created_at", :null => false
  48. t.datetime "updated_at", :null => false
  49. end
  50. create_table "current_values", :force => true do |t|
  51. t.integer "value"
  52. t.string "description"
  53. t.datetime "created_at", :null => false
  54. t.datetime "updated_at", :null => false
  55. end
  56. create_table "data_qualities", :force => true do |t|
  57. t.string "name"
  58. t.datetime "created_at", :null => false
  59. t.datetime "updated_at", :null => false
  60. end
  61. create_table "emix_units", :force => true do |t|
  62. t.string "name"
  63. t.string "description"
  64. t.string "custom_units"
  65. t.decimal "hertz", :precision => 10, :scale => 0
  66. t.decimal "voltage", :precision => 10, :scale => 0
  67. t.boolean "ac"
  68. t.integer "si_scale_code_id"
  69. t.integer "unit_type_id"
  70. t.datetime "created_at", :null => false
  71. t.datetime "updated_at", :null => false
  72. t.integer "currency_type_id"
  73. end
  74. create_table "end_device_assets", :force => true do |t|
  75. t.string "name"
  76. t.datetime "created_at", :null => false
  77. t.datetime "updated_at", :null => false
  78. end
  79. add_index "end_device_assets", ["name"], :name => "index_end_device_assets_on_name", :unique => true
  80. create_table "event_groups", :force => true do |t|
  81. t.integer "event_id"
  82. t.integer "group_id"
  83. t.datetime "created_at", :null => false
  84. t.datetime "updated_at", :null => false
  85. end
  86. add_index "event_groups", ["event_id", "group_id"], :name => "event_groups_unique", :unique => true
  87. add_index "event_groups", ["event_id"], :name => "index_event_groups_on_event_id"
  88. add_index "event_groups", ["group_id"], :name => "index_event_groups_on_group_id"
  89. create_table "event_opts", :force => true do |t|
  90. t.string "opt_id"
  91. t.string "request_id"
  92. t.integer "event_modification_number"
  93. t.integer "ven_id"
  94. t.integer "resource_id"
  95. t.integer "event_id"
  96. t.integer "opt_type_id"
  97. t.integer "opt_reason_id"
  98. t.integer "market_context_id"
  99. t.datetime "created_at", :null => false
  100. t.datetime "updated_at", :null => false
  101. t.boolean "is_create_opt"
  102. end
  103. add_index "event_opts", ["event_id", "ven_id", "created_at"], :name => "index_event_opts_on_event_id_and_ven_id_and_created_at"
  104. add_index "event_opts", ["event_id"], :name => "index_event_opts_on_event_id"
  105. add_index "event_opts", ["market_context_id"], :name => "index_event_opts_on_market_context_id"
  106. add_index "event_opts", ["opt_reason_id"], :name => "index_event_opts_on_opt_reason_id"
  107. add_index "event_opts", ["opt_type_id"], :name => "index_event_opts_on_opt_type_id"
  108. add_index "event_opts", ["resource_id"], :name => "index_event_opts_on_resource_id"
  109. add_index "event_opts", ["ven_id"], :name => "index_event_opts_on_ven_id"
  110. create_table "event_parties", :force => true do |t|
  111. t.integer "event_id"
  112. t.integer "market_context_subscription_id"
  113. t.datetime "created_at", :null => false
  114. t.datetime "updated_at", :null => false
  115. end
  116. add_index "event_parties", ["event_id", "market_context_subscription_id"], :name => "event_parties_unique", :unique => true
  117. add_index "event_parties", ["event_id"], :name => "index_event_parties_on_event_id"
  118. add_index "event_parties", ["market_context_subscription_id"], :name => "index_event_parties_on_market_context_subscription_id"
  119. create_table "event_resources", :force => true do |t|
  120. t.integer "event_id"
  121. t.integer "resource_type_id"
  122. t.datetime "created_at", :null => false
  123. t.datetime "updated_at", :null => false
  124. end
  125. add_index "event_resources", ["event_id", "resource_type_id"], :name => "event_resources_unique", :unique => true
  126. add_index "event_resources", ["event_id"], :name => "index_event_resources_on_event_id"
  127. add_index "event_resources", ["resource_type_id"], :name => "index_event_resources_on_resource_type_id"
  128. create_table "event_responses", :force => true do |t|
  129. t.string "response_code"
  130. t.string "response_description"
  131. t.string "request_id"
  132. t.integer "modification_number"
  133. t.string "opt_type"
  134. t.integer "event_id"
  135. t.datetime "created_at", :null => false
  136. t.datetime "updated_at", :null => false
  137. t.integer "ven_id"
  138. end
  139. add_index "event_responses", ["event_id"], :name => "index_event_responses_on_event_id"
  140. create_table "event_signal_intervals", :force => true do |t|
  141. t.integer "duration"
  142. t.integer "uid"
  143. t.integer "payload_type_id"
  144. t.datetime "created_at", :null => false
  145. t.datetime "updated_at", :null => false
  146. t.integer "event_signal_id"
  147. t.datetime "dtstart"
  148. t.decimal "payload", :precision => 13, :scale => 3
  149. t.float "payload_a"
  150. end
  151. add_index "event_signal_intervals", ["event_signal_id"], :name => "index_event_signal_intervals_on_event_signal_id"
  152. create_table "event_signals", :force => true do |t|
  153. t.string "name"
  154. t.integer "signal_type_id"
  155. t.string "signal_id"
  156. t.integer "event_id"
  157. t.datetime "created_at", :null => false
  158. t.datetime "updated_at", :null => false
  159. t.integer "signal_name_id"
  160. t.integer "emix_unit_id"
  161. t.boolean "baseline"
  162. t.string "baseline_id"
  163. t.string "baseline_name"
  164. t.datetime "dtstart"
  165. t.integer "duration"
  166. t.integer "end_device_asset_id"
  167. end
  168. add_index "event_signals", ["event_id"], :name => "index_event_signals_on_event_id"
  169. create_table "event_statuses", :force => true do |t|
  170. t.string "name"
  171. t.datetime "created_at", :null => false
  172. t.datetime "updated_at", :null => false
  173. t.string "description"
  174. end
  175. create_table "event_targets", :force => true do |t|
  176. t.integer "event_id"
  177. t.integer "target_id"
  178. t.datetime "created_at", :null => false
  179. t.datetime "updated_at", :null => false
  180. end
  181. add_index "event_targets", ["event_id", "target_id"], :name => "index_event_targets_on_event_id_and_target_id", :unique => true
  182. create_table "event_vens", :force => true do |t|
  183. t.integer "event_id"
  184. t.integer "ven_id"
  185. t.datetime "created_at", :null => false
  186. t.datetime "updated_at", :null => false
  187. end
  188. add_index "event_vens", ["event_id", "ven_id"], :name => "event_vens_unique", :unique => true
  189. add_index "event_vens", ["event_id"], :name => "index_event_vens_on_event_id"
  190. add_index "event_vens", ["ven_id"], :name => "index_event_vens_on_ven_id"
  191. create_table "events", :force => true do |t|
  192. t.string "event_id"
  193. t.integer "modification_number"
  194. t.integer "priority"
  195. t.integer "market_context_id"
  196. t.integer "event_status_id"
  197. t.string "test_event"
  198. t.string "vtn_comment"
  199. t.datetime "dtstart"
  200. t.integer "duration"
  201. t.integer "tolerance", :default => 0
  202. t.integer "ei_notification"
  203. t.integer "ei_rampup", :default => 0
  204. t.integer "ei_recovery", :default => 0
  205. t.datetime "created_at", :null => false
  206. t.datetime "updated_at", :null => false
  207. t.integer "response_required_type_id"
  208. t.boolean "template"
  209. t.integer "schedule_id"
  210. t.boolean "published"
  211. t.text "payload"
  212. t.integer "account_id"
  213. t.boolean "include_subscribed_vens_only"
  214. t.boolean "include_party_id"
  215. t.string "time_zone", :default => "UTC"
  216. t.string "event_interface_name"
  217. end
  218. add_index "events", ["account_id"], :name => "index_events_on_account_id"
  219. create_table "group_members", :force => true do |t|
  220. t.integer "group_id"
  221. t.integer "account_id"
  222. t.datetime "created_at", :null => false
  223. t.datetime "updated_at", :null => false
  224. end
  225. add_index "group_members", ["account_id", "group_id"], :name => "index_group_members_on_account_id_and_group_id", :unique => true
  226. add_index "group_members", ["account_id"], :name => "index_group_members_on_account_id"
  227. add_index "group_members", ["group_id"], :name => "index_group_members_on_group_id"
  228. create_table "groups", :force => true do |t|
  229. t.string "name"
  230. t.string "description"
  231. t.datetime "created_at", :null => false
  232. t.datetime "updated_at", :null => false
  233. end
  234. create_table "holidays", :force => true do |t|
  235. t.string "name"
  236. t.date "date"
  237. t.datetime "created_at", :null => false
  238. t.datetime "updated_at", :null => false
  239. end
  240. add_index "holidays", ["date"], :name => "index_holidays_on_date"
  241. create_table "intervals", :force => true do |t|
  242. t.datetime "dtstart"
  243. t.string "duration"
  244. t.integer "uid"
  245. t.text "payload"
  246. t.datetime "created_at", :null => false
  247. t.datetime "updated_at", :null => false
  248. end
  249. create_table "market_context_subscriptions", :force => true do |t|
  250. t.integer "market_context_id"
  251. t.integer "ven_id"
  252. t.datetime "created_at", :null => false
  253. t.datetime "updated_at", :null => false
  254. t.string "party_name"
  255. end
  256. add_index "market_context_subscriptions", ["market_context_id", "ven_id"], :name => "mkt_ctxt_mkt_ct_id_ven_id", :unique => true
  257. add_index "market_context_subscriptions", ["market_context_id"], :name => "index_market_context_subscriptions_on_market_context_id"
  258. add_index "market_context_subscriptions", ["ven_id"], :name => "index_market_context_subscriptions_on_ven_id"
  259. create_table "market_contexts", :force => true do |t|
  260. t.string "name"
  261. t.string "description"
  262. t.datetime "created_at", :null => false
  263. t.datetime "updated_at", :null => false
  264. t.string "color"
  265. end
  266. create_table "oadr_test_cases", :force => true do |t|
  267. t.string "name"
  268. t.datetime "created_at", :null => false
  269. t.datetime "updated_at", :null => false
  270. t.string "target"
  271. t.string "version"
  272. t.string "direction"
  273. end
  274. create_table "opt_reasons", :force => true do |t|
  275. t.string "name"
  276. t.string "description"
  277. t.datetime "created_at", :null => false
  278. t.datetime "updated_at", :null => false
  279. end
  280. create_table "opt_schedule_durations", :force => true do |t|
  281. t.datetime "dtstart"
  282. t.string "duration"
  283. t.string "tolerance"
  284. t.string "ei_notification"
  285. t.string "ei_ramp_up"
  286. t.string "ei_recovery"
  287. t.integer "opt_schedule_id"
  288. t.datetime "created_at", :null => false
  289. t.datetime "updated_at", :null => false
  290. end
  291. add_index "opt_schedule_durations", ["opt_schedule_id"], :name => "index_opt_schedule_durations_on_opt_schedule_id"
  292. create_table "opt_schedules", :force => true do |t|
  293. t.string "request_id"
  294. t.string "opt_id"
  295. t.integer "opt_type_id"
  296. t.integer "opt_reason_id"
  297. t.integer "market_context_id"
  298. t.integer "ven_id"
  299. t.integer "resource_id"
  300. t.datetime "created_at", :null => false
  301. t.datetime "updated_at", :null => false
  302. t.boolean "active"
  303. end
  304. add_index "opt_schedules", ["market_context_id"], :name => "index_opt_schedules_on_market_context_id"
  305. add_index "opt_schedules", ["opt_reason_id"], :name => "index_opt_schedules_on_opt_reason_id"
  306. add_index "opt_schedules", ["opt_type_id"], :name => "index_opt_schedules_on_opt_type_id"
  307. add_index "opt_schedules", ["resource_id"], :name => "index_opt_schedules_on_resource_id"
  308. add_index "opt_schedules", ["ven_id"], :name => "index_opt_schedules_on_ven_id"
  309. create_table "opt_types", :force => true do |t|
  310. t.string "name"
  311. t.string "description"
  312. t.datetime "created_at", :null => false
  313. t.datetime "updated_at", :null => false
  314. end
  315. create_table "payload_types", :force => true do |t|
  316. t.integer "value"
  317. t.string "name"
  318. t.datetime "created_at", :null => false
  319. t.datetime "updated_at", :null => false
  320. end
  321. create_table "profiles", :force => true do |t|
  322. t.string "name"
  323. t.datetime "created_at", :null => false
  324. t.datetime "updated_at", :null => false
  325. end
  326. create_table "reading_types", :force => true do |t|
  327. t.string "name"
  328. t.datetime "created_at", :null => false
  329. t.datetime "updated_at", :null => false
  330. end
  331. create_table "registrations", :force => true do |t|
  332. t.string "request_id"
  333. t.string "registration_id"
  334. t.string "ven_name"
  335. t.string "oadr_profile_name"
  336. t.string "oadr_transport_name"
  337. t.string "oadr_transport_address"
  338. t.boolean "oadr_report_only"
  339. t.boolean "oadr_xml_signature"
  340. t.string "oadr_ven_name"
  341. t.boolean "oadr_http_pull_model"
  342. t.datetime "created_at", :null => false
  343. t.datetime "updated_at", :null => false
  344. t.integer "ven_id"
  345. end
  346. create_table "report_instances", :force => true do |t|
  347. t.string "report_request_id"
  348. t.datetime "dtstart"
  349. t.string "duration"
  350. t.string "created_date_time"
  351. t.datetime "created_at", :null => false
  352. t.datetime "updated_at", :null => false
  353. t.string "ei_report_id"
  354. t.integer "report_id"
  355. end
  356. create_table "report_interval_descriptions", :force => true do |t|
  357. t.string "rid"
  358. t.string "report_subject"
  359. t.string "report_data_source"
  360. t.integer "report_type_id"
  361. t.string "emix_item"
  362. t.integer "reading_type_id"
  363. t.string "market_context"
  364. t.string "sampling_rate_min_period"
  365. t.string "sampling_rate_max_period"
  366. t.boolean "sampling_rate_on_change"
  367. t.datetime "created_at", :null => false
  368. t.datetime "updated_at", :null => false
  369. t.integer "report_id"
  370. t.string "item_description"
  371. t.string "item_units"
  372. t.string "si_scale_code"
  373. t.float "pulse_multiplier"
  374. t.decimal "hertz", :precision => 10, :scale => 3
  375. t.decimal "voltage", :precision => 10, :scale => 3
  376. t.boolean "ac"
  377. t.boolean "is_active", :default => true
  378. end
  379. add_index "report_interval_descriptions", ["reading_type_id"], :name => "index_interval_report_descriptions_on_reading_type_id"
  380. add_index "report_interval_descriptions", ["report_type_id"], :name => "index_interval_report_descriptions_on_report_type_id"
  381. create_table "report_intervals", :force => true do |t|
  382. t.string "rid"
  383. t.integer "confidence"
  384. t.float "accuracy"
  385. t.integer "data_quality_id"
  386. t.float "value"
  387. t.integer "resource_status_id"
  388. t.datetime "created_at", :null => false
  389. t.datetime "updated_at", :null => false
  390. t.boolean "online"
  391. t.boolean "manual_override"
  392. t.datetime "dtstart"
  393. t.string "duration"
  394. t.integer "uid"
  395. t.integer "report_instance_id"
  396. t.integer "report_interval_description_id"
  397. t.integer "report_id"
  398. end
  399. add_index "report_intervals", ["data_quality_id"], :name => "index_interval_report_payloads_on_data_quality_id"
  400. add_index "report_intervals", ["report_id"], :name => "index_report_intervals_on_report_id"
  401. add_index "report_intervals", ["report_interval_description_id", "dtstart"], :name => "index_report_intervals_on_rep_int_desc_id_and_dtstart", :unique => true
  402. add_index "report_intervals", ["resource_status_id"], :name => "index_interval_report_payloads_on_resource_status_id"
  403. create_table "report_names", :force => true do |t|
  404. t.string "name"
  405. t.datetime "created_at", :null => false
  406. t.datetime "updated_at", :null => false
  407. end
  408. create_table "report_request_configurations", :force => true do |t|
  409. t.string "sampling_rate_min_period"
  410. t.string "sampling_rate_max_period"
  411. t.integer "report_name_id"
  412. t.boolean "sampling_rate_on_change"
  413. t.string "granularity"
  414. t.string "report_back_duration"
  415. t.datetime "created_at", :null => false
  416. t.datetime "updated_at", :null => false
  417. t.string "name"
  418. end
  419. create_table "report_request_descriptions", :force => true do |t|
  420. t.integer "report_request_id"
  421. t.integer "report_interval_description_id"
  422. t.datetime "created_at", :null => false
  423. t.datetime "updated_at", :null => false
  424. end
  425. add_index "report_request_descriptions", ["report_interval_description_id"], :name => "idx_report_interval_description_id"
  426. add_index "report_request_descriptions", ["report_request_id"], :name => "idx_report_request_id"
  427. create_table "report_requests", :force => true do |t|
  428. t.string "request_id"
  429. t.string "granularity"
  430. t.string "report_back_duration"
  431. t.datetime "dtstart"
  432. t.string "duration"
  433. t.integer "report_id"
  434. t.datetime "created_at", :null => false
  435. t.datetime "updated_at", :null => false
  436. t.integer "create_report_id"
  437. t.boolean "is_metadata"
  438. end
  439. add_index "report_requests", ["report_id"], :name => "index_report_requests_on_report_id"
  440. create_table "report_types", :force => true do |t|
  441. t.string "name"
  442. t.datetime "created_at", :null => false
  443. t.datetime "updated_at", :null => false
  444. end
  445. create_table "reports", :force => true do |t|
  446. t.string "report_specifier_id"
  447. t.datetime "created_date_time"
  448. t.string "report_request_id"
  449. t.string "duration"
  450. t.integer "report_name_id"
  451. t.datetime "created_at", :null => false
  452. t.datetime "updated_at", :null => false
  453. t.integer "ven_id"
  454. t.boolean "is_active", :default => true
  455. end
  456. add_index "reports", ["report_name_id"], :name => "index_reports_on_report_name_id"
  457. create_table "resource_statuses", :force => true do |t|
  458. t.boolean "online"
  459. t.boolean "manual_override"
  460. t.float "capacity_min"
  461. t.float "capacity_max"
  462. t.float "capacity_current"
  463. t.float "capacity_normal"
  464. t.float "level_offset_min"
  465. t.float "level_offset_max"
  466. t.float "level_offset_current"
  467. t.float "level_offset_normal"
  468. t.float "percent_offset_min"
  469. t.float "percent_offset_max"
  470. t.float "percent_offset_current"
  471. t.float "percent_offset_normal"
  472. t.float "set_point_min"
  473. t.float "set_point_max"
  474. t.float "set_point_current"
  475. t.float "set_point_normal"
  476. t.integer "resource_id"
  477. t.integer "interval_report_payload_id"
  478. t.datetime "created_at", :null => false
  479. t.datetime "updated_at", :null => false
  480. end
  481. add_index "resource_statuses", ["interval_report_payload_id"], :name => "index_resource_statuses_on_interval_report_payload_id"
  482. add_index "resource_statuses", ["resource_id"], :name => "index_resource_statuses_on_resource_id"
  483. create_table "resource_types", :force => true do |t|
  484. t.string "name"
  485. t.string "description"
  486. t.datetime "created_at", :null => false
  487. t.datetime "updated_at", :null => false
  488. end
  489. create_table "resources", :force => true do |t|
  490. t.string "address"
  491. t.string "state"
  492. t.integer "zip"
  493. t.string "geospatial_location"
  494. t.string "grid_electrical_coordinates"
  495. t.float "shed_capability"
  496. t.integer "ramp_period"
  497. t.integer "recovery_period"
  498. t.integer "ven_id"
  499. t.integer "resource_type_id"
  500. t.datetime "created_at", :null => false
  501. t.datetime "updated_at", :null => false
  502. t.string "name"
  503. end
  504. add_index "resources", ["resource_type_id"], :name => "index_resources_on_resource_type_id"
  505. add_index "resources", ["ven_id"], :name => "index_resources_on_ven_id"
  506. create_table "response_required_types", :force => true do |t|
  507. t.string "name"
  508. t.string "description"
  509. t.datetime "created_at", :null => false
  510. t.datetime "updated_at", :null => false
  511. end
  512. create_table "schedules", :force => true do |t|
  513. t.date "start_date"
  514. t.date "end_date"
  515. t.integer "start_time"
  516. t.boolean "sunday"
  517. t.boolean "monday"
  518. t.boolean "tuesday"
  519. t.boolean "wednesday"
  520. t.boolean "thursday"
  521. t.boolean "friday"
  522. t.boolean "saturday"
  523. t.integer "event_id"
  524. t.datetime "created_at", :null => false
  525. t.datetime "updated_at", :null => false
  526. t.string "comment"
  527. end
  528. add_index "schedules", ["event_id"], :name => "index_schedules_on_event_id"
  529. create_table "service_types", :force => true do |t|
  530. t.string "name"
  531. t.text "description"
  532. t.datetime "created_at", :null => false
  533. t.datetime "updated_at", :null => false
  534. end
  535. create_table "si_scale_codes", :force => true do |t|
  536. t.string "name"
  537. t.string "description"
  538. t.datetime "created_at", :null => false
  539. t.datetime "updated_at", :null => false
  540. t.integer "multiplier"
  541. end
  542. create_table "signal_names", :force => true do |t|
  543. t.string "name"
  544. t.string "description"
  545. t.datetime "created_at", :null => false
  546. t.datetime "updated_at", :null => false
  547. end
  548. create_table "signal_types", :force => true do |t|
  549. t.string "name"
  550. t.string "description"
  551. t.datetime "created_at", :null => false
  552. t.datetime "updated_at", :null => false
  553. end
  554. create_table "targets", :force => true do |t|
  555. t.string "name"
  556. t.string "description"
  557. t.datetime "created_at", :null => false
  558. t.datetime "updated_at", :null => false
  559. t.integer "vens_count", :default => 0, :null => false
  560. t.string "tag"
  561. t.integer "parent_id"
  562. t.string "type"
  563. t.integer "market_context_id"
  564. end
  565. add_index "targets", ["name", "type"], :name => "index_targets_on_name_and_type", :unique => true
  566. add_index "targets", ["tag"], :name => "index_targets_on_tag"
  567. create_table "test_case_prompts", :force => true do |t|
  568. t.string "name"
  569. t.string "test_cases"
  570. t.text "instructions"
  571. t.boolean "ported"
  572. t.datetime "created_at", :null => false
  573. t.datetime "updated_at", :null => false
  574. end
  575. create_table "tou_schedules", :force => true do |t|
  576. t.string "month_01_season"
  577. t.string "month_02_season"
  578. t.string "month_03_season"
  579. t.string "month_04_season"
  580. t.string "month_05_season"
  581. t.string "month_06_season"
  582. t.string "month_07_season"
  583. t.string "month_08_season"
  584. t.string "month_09_season"
  585. t.string "month_10_season"
  586. t.string "month_11_season"
  587. t.string "month_12_season"
  588. t.decimal "hour_00_winter", :precision => 5, :scale => 2
  589. t.decimal "hour_01_winter", :precision => 5, :scale => 2
  590. t.decimal "hour_02_winter", :precision => 5, :scale => 2
  591. t.decimal "hour_03_winter", :precision => 5, :scale => 2
  592. t.decimal "hour_04_winter", :precision => 5, :scale => 2
  593. t.decimal "hour_05_winter", :precision => 5, :scale => 2
  594. t.decimal "hour_06_winter", :precision => 5, :scale => 2
  595. t.decimal "hour_07_winter", :precision => 5, :scale => 2
  596. t.decimal "hour_08_winter", :precision => 5, :scale => 2
  597. t.decimal "hour_09_winter", :precision => 5, :scale => 2
  598. t.decimal "hour_10_winter", :precision => 5, :scale => 2
  599. t.decimal "hour_11_winter", :precision => 5, :scale => 2
  600. t.decimal "hour_12_winter", :precision => 5, :scale => 2
  601. t.decimal "hour_13_winter", :precision => 5, :scale => 2
  602. t.decimal "hour_14_winter", :precision => 5, :scale => 2
  603. t.decimal "hour_15_winter", :precision => 5, :scale => 2
  604. t.decimal "hour_16_winter", :precision => 5, :scale => 2
  605. t.decimal "hour_17_winter", :precision => 5, :scale => 2
  606. t.decimal "hour_18_winter", :precision => 5, :scale => 2
  607. t.decimal "hour_19_winter", :precision => 5, :scale => 2
  608. t.decimal "hour_20_winter", :precision => 5, :scale => 2
  609. t.decimal "hour_21_winter", :precision => 5, :scale => 2
  610. t.decimal "hour_22_winter", :precision => 5, :scale => 2
  611. t.decimal "hour_23_winter", :precision => 5, :scale => 2
  612. t.decimal "hour_00_summer", :precision => 5, :scale => 2
  613. t.decimal "hour_01_summer", :precision => 5, :scale => 2
  614. t.decimal "hour_02_summer", :precision => 5, :scale => 2
  615. t.decimal "hour_03_summer", :precision => 5, :scale => 2
  616. t.decimal "hour_04_summer", :precision => 5, :scale => 2
  617. t.decimal "hour_05_summer", :precision => 5, :scale => 2
  618. t.decimal "hour_06_summer", :precision => 5, :scale => 2
  619. t.decimal "hour_07_summer", :precision => 5, :scale => 2
  620. t.decimal "hour_08_summer", :precision => 5, :scale => 2
  621. t.decimal "hour_09_summer", :precision => 5, :scale => 2
  622. t.decimal "hour_10_summer", :precision => 5, :scale => 2
  623. t.decimal "hour_11_summer", :precision => 5, :scale => 2
  624. t.decimal "hour_12_summer", :precision => 5, :scale => 2
  625. t.decimal "hour_13_summer", :precision => 5, :scale => 2
  626. t.decimal "hour_14_summer", :precision => 5, :scale => 2
  627. t.decimal "hour_15_summer", :precision => 5, :scale => 2
  628. t.decimal "hour_16_summer", :precision => 5, :scale => 2
  629. t.decimal "hour_17_summer", :precision => 5, :scale => 2
  630. t.decimal "hour_18_summer", :precision => 5, :scale => 2
  631. t.decimal "hour_19_summer", :precision => 5, :scale => 2
  632. t.decimal "hour_20_summer", :precision => 5, :scale => 2
  633. t.decimal "hour_21_summer", :precision => 5, :scale => 2
  634. t.decimal "hour_22_summer", :precision => 5, :scale => 2
  635. t.decimal "hour_23_summer", :precision => 5, :scale => 2
  636. t.string "time_zone", :default => "UTC"
  637. t.boolean "is_active", :default => true
  638. t.datetime "created_at", :null => false
  639. t.datetime "updated_at", :null => false
  640. t.integer "signal_type_id"
  641. t.integer "payload_unit_id"
  642. t.integer "market_context_id"
  643. t.integer "target_id"
  644. t.string "name"
  645. end
  646. add_index "tou_schedules", ["name"], :name => "index_tou_schedules_on_name", :unique => true
  647. create_table "unit_types", :force => true do |t|
  648. t.string "name"
  649. t.string "description"
  650. t.datetime "created_at", :null => false
  651. t.datetime "updated_at", :null => false
  652. end
  653. create_table "utility_devices", :force => true do |t|
  654. t.string "customer_name"
  655. t.string "customer_address"
  656. t.string "customer_address_2"
  657. t.string "customer_city"
  658. t.string "customer_state"
  659. t.string "customer_zip"
  660. t.integer "utility_location_id"
  661. t.datetime "created_at", :null => false
  662. t.datetime "updated_at", :null => false
  663. t.string "ucm"
  664. t.integer "utility_equipment_type_id"
  665. t.integer "program_id"
  666. end
  667. create_table "utility_equipment_types", :force => true do |t|
  668. t.string "name"
  669. t.integer "target_id"
  670. t.datetime "created_at", :null => false
  671. t.datetime "updated_at", :null => false
  672. end
  673. create_table "utility_locations", :force => true do |t|
  674. t.integer "target_id"
  675. t.string "type"
  676. t.integer "parent_id"
  677. t.string "name"
  678. t.datetime "created_at", :null => false
  679. t.datetime "updated_at", :null => false
  680. end
  681. create_table "ven_messages", :force => true do |t|
  682. t.text "oadr_message"
  683. t.integer "ven_id"
  684. t.datetime "created_at", :null => false
  685. t.datetime "updated_at", :null => false
  686. t.integer "service_type_id"
  687. end
  688. add_index "ven_messages", ["ven_id"], :name => "index_ven_messages_on_ven_id"
  689. create_table "ven_polls", :force => true do |t|
  690. t.integer "ven_id"
  691. t.datetime "created_at", :null => false
  692. t.datetime "updated_at", :null => false
  693. end
  694. add_index "ven_polls", ["created_at"], :name => "index_ven_polls_on_created_at"
  695. add_index "ven_polls", ["ven_id"], :name => "index_ven_polls_on_ven_id"
  696. create_table "ven_targets", :force => true do |t|
  697. t.integer "ven_id"
  698. t.integer "target_id"
  699. t.datetime "created_at", :null => false
  700. t.datetime "updated_at", :null => false
  701. end
  702. add_index "ven_targets", ["ven_id", "target_id"], :name => "index_ven_targets_on_ven_id_and_target_id", :unique => true
  703. create_table "vens", :force => true do |t|
  704. t.string "name"
  705. t.string "email"
  706. t.string "address"
  707. t.string "state"
  708. t.string "zip"
  709. t.string "geospatial_location"
  710. t.string "grid_electrical_coordinates"
  711. t.float "shed_capability"
  712. t.integer "ramp_period"
  713. t.integer "recovery_period"
  714. t.integer "account_id"
  715. t.datetime "created_at", :null => false
  716. t.datetime "updated_at", :null => false
  717. t.integer "registration_id"
  718. t.string "ven_id"
  719. t.string "common_name"
  720. t.text "distribute_event_payload"
  721. t.integer "profile_id"
  722. t.boolean "http_push"
  723. t.string "transport_address"
  724. t.datetime "last_comm_at"
  725. t.string "time_zone", :default => "UTC"
  726. t.string "ven_interface_name"
  727. t.string "address_label"
  728. t.string "address_extra"
  729. t.string "city"
  730. end
  731. add_index "vens", ["account_id"], :name => "index_vens_on_account_id"
  732. add_index "vens", ["common_name"], :name => "index_vens_on_common_name", :unique => true
  733. add_index "vens", ["ven_id"], :name => "index_vens_on_ven_id", :unique => true
  734. create_table "vtn_parameters", :force => true do |t|
  735. t.string "vtn_name"
  736. t.integer "poll_interval"
  737. t.datetime "created_at", :null => false
  738. t.datetime "updated_at", :null => false
  739. t.integer "ven_id"
  740. t.string "endpoint20a_url"
  741. t.string "endpoint20b_url"
  742. end
  743. end