michaelmior /
NoSE
| 1 | # frozen_string_literal: true |
||
| 2 | |||
| 3 | require_relative '../lib/nose.rb' |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 4 | |||
| 5 | NoSE::Schema.new do |
||
|
0 ignored issues
–
show
|
|||
| 6 | Model 'rubis' |
||
| 7 | |||
| 8 | SimpleIndex 'categories' |
||
| 9 | SimpleIndex 'regions' |
||
| 10 | SimpleIndex 'items' |
||
| 11 | SimpleIndex 'comments' |
||
| 12 | |||
| 13 | Index 'users_by_region' do |
||
| 14 | Hash regions.id |
||
| 15 | Ordered users.id |
||
| 16 | Extra users.nickname |
||
| 17 | Path regions.id, regions.users |
||
| 18 | end |
||
| 19 | |||
| 20 | Index 'users' do |
||
| 21 | Hash users.id |
||
| 22 | Ordered regions.id |
||
| 23 | Extra users['*'] |
||
| 24 | Path users.id, users.region |
||
| 25 | end |
||
| 26 | |||
| 27 | Index 'bids' do |
||
| 28 | Hash bids.id |
||
| 29 | Ordered users.id, items.id |
||
| 30 | Extra bids['*'] |
||
| 31 | Path users.id, users.bids, bids.item |
||
| 32 | end |
||
| 33 | |||
| 34 | Index 'buynow' do |
||
| 35 | Hash buynow.id |
||
| 36 | Ordered items.id |
||
| 37 | Extra buynow['*'] |
||
| 38 | Path buynow.id, buynow.item |
||
| 39 | end |
||
| 40 | |||
| 41 | Index 'all_categories' do |
||
| 42 | Hash categories.dummy |
||
| 43 | Ordered categories.id |
||
| 44 | Path categories.id |
||
| 45 | end |
||
| 46 | |||
| 47 | Index 'all_regions' do |
||
| 48 | Hash regions.dummy |
||
| 49 | Ordered regions.id |
||
| 50 | Path regions.id |
||
| 51 | end |
||
| 52 | |||
| 53 | Index 'bids_by_item' do |
||
| 54 | Hash items.id |
||
| 55 | Ordered bids.id |
||
| 56 | Path items.id, items.bids |
||
| 57 | end |
||
| 58 | |||
| 59 | Index 'items_by_category' do |
||
| 60 | Hash categories.id |
||
| 61 | Ordered items.end_date, items.id |
||
| 62 | Path categories.id, categories.items |
||
| 63 | end |
||
| 64 | |||
| 65 | Index 'items_by_region' do |
||
| 66 | Hash regions.id |
||
| 67 | Ordered categories.id, items.end_date, items.id, users.id |
||
| 68 | Path regions.id, regions.users, users.items_sold, items.category |
||
| 69 | end |
||
| 70 | |||
| 71 | Index 'comments_by_user' do |
||
| 72 | Hash users.id |
||
| 73 | Ordered comments.id |
||
| 74 | Path users.id, users.comments_received |
||
| 75 | end |
||
| 76 | |||
| 77 | Index 'user_items_sold' do |
||
| 78 | Hash users.id |
||
| 79 | Ordered items.end_date, items.id |
||
| 80 | Path users.id, users.items_sold |
||
| 81 | end |
||
| 82 | |||
| 83 | Index 'buynow_by_user' do |
||
| 84 | Hash users.id |
||
| 85 | Ordered buynow.date, buynow.id |
||
| 86 | Path users.id, users.bought_now |
||
| 87 | end |
||
| 88 | |||
| 89 | Index 'bids_by_user' do |
||
| 90 | Hash users.id |
||
| 91 | Ordered bids.date, bids.id |
||
| 92 | Path users.id, users.bids |
||
| 93 | end |
||
| 94 | end |
||
| 95 |