Class: CabooseRets::Schema

Inherits:
Caboose::Utilities::Schema
  • Object
show all
Defined in:
app/models/caboose_rets/schema.rb

Class Method Summary collapse

Class Method Details

.indexesObject



12
13
14
15
16
# File 'app/models/caboose_rets/schema.rb', line 12

def self.indexes
  {
    CabooseRets::Media => [:media_id]
  }    
end

.load_dataObject



859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
# File 'app/models/caboose_rets/schema.rb', line 859

def self.load_data
      
  bt = Caboose::BlockType.where(:name => 'layout_rets').first
  if bt.nil?
    cat = Caboose::BlockTypeCategory.where(:name => 'Layouts').first      
    bt = Caboose::BlockType.create(:name => 'layout_rets', :description => 'RETS Layout', :block_type_category_id => cat.id, :allow_child_blocks => false, :field_type => 'block')
  end
  
  Caboose::Site.where(:use_rets => true).reorder(:id).all.each do |site|
    
    home_page = Caboose::Page.index_page(site.id)
    
    # Check that the rets layout is applied to the site
    bt.add_to_site(site.id)
    
    # Verify that the site has all the rets pages created and each page has the rets layout
    rets_page = Caboose::Page.where(:site_id => site.id, :alias => 'rets').first
    rets_page = Caboose::Page.create(:site_id => site.id, :alias => 'rets', :slug => 'rets', :uri => 'rets', :title => 'RETS', :parent_id => home_page.id) if rets_page.nil?        
            
    pages = []      
    if !Caboose::Page.where(:site_id => site.id, :alias => 'residential'      ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'residential'      , :alias => 'residential'      , :uri => 'residential'      , :title => 'Residential Properties'  , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'commercia'        ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'commercial'       , :alias => 'commercial'       , :uri => 'commercial'       , :title => 'Commercial Properties'   , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'land'             ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'land'             , :alias => 'land'             , :uri => 'land'             , :title => 'Land'                    , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'multi-family'     ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'multi-family'     , :alias => 'multi-family'     , :uri => 'multi-family'     , :title => 'Multi-family Properties' , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'open-houses'      ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'open-houses'      , :alias => 'open-houses'      , :uri => 'open-houses'      , :title => 'Open Houses'             , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'agents'           ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'agents'           , :alias => 'agents'           , :uri => 'agents'           , :title => 'Agents'                  , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'saved-searches'   ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'saved-searches'   , :alias => 'saved-searches'   , :uri => 'saved-searches'   , :title => 'Saved Searches'          , :parent_id => rets_page.id) end
    if !Caboose::Page.where(:site_id => site.id, :alias => 'saved-properties' ).exists? then pages << Caboose::Page.create(:site_id => site.id, :slug => 'saved-properties' , :alias => 'saved-properties' , :uri => 'saved-properties' , :title => 'Saved Properties'        , :parent_id => rets_page.id) end

    pages.each do |p|
      Caboose::Block.where(:page_id =>  p.id).destroy_all
      Caboose::Block.create(:page_id => p.id, :block_type_id => bt.id, :name => bt.name)
      
      viewers = Caboose::PagePermission.where(:page_id => home_page.id, :action => 'view').pluck(:role_id)
      editors = Caboose::PagePermission.where(:page_id => home_page.id, :action => 'edit').pluck(:role_id)
      Caboose::Page.update_authorized_for_action(p.id, 'view', viewers)
      Caboose::Page.update_authorized_for_action(p.id, 'edit', editors)
    end
    
  end
  
end

.removed_columnsObject



4
5
6
7
8
9
10
# File 'app/models/caboose_rets/schema.rb', line 4

def self.removed_columns
  {
    CabooseRets::CommercialProperty => [ :virtual_tour ],
    CabooseRets::ResidentialProperty => [ :virtual_tour ],
    CabooseRets::ResidentialProperty => [ :acreage_temp ]
  }
end

.schemaObject

The schema of the database { Model => [[name, data_type, options]] }



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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
# File 'app/models/caboose_rets/schema.rb', line 20

def self.schema      
  {
    CabooseRets::Agent => [
      [ :beeper_phone        , :string ],
      [ :last_name           , :string ],
      [ :member_email        , :string ],
      [ :phone_home_fax      , :string ],
      [ :car_phone           , :string ],
      [ :la_code             , :string ],
      [ :member_page         , :string ],
      [ :phone_pager         , :string ],
      [ :date_created        , :string ],
      [ :lo_code             , :string ],
      [ :member_status       , :string ],
      [ :phone_second_home   , :string ],
      [ :date_modified       , :string ],
      [ :mail_addr1          , :string ],
      [ :nrds_id             , :string ],
      [ :phone_toll_free     , :string ],
      [ :defaultemail        , :string ],
      [ :mail_addr2          , :string ],
      [ :office_phone        , :string ],
      [ :phone_voice_mail    , :string ],
      [ :fax_phone           , :string ],
      [ :mail_city           , :string ],
      [ :other_phone         , :string ],
      [ :phone_voice_pager   , :string ],
      [ :first_name          , :string ],
      [ :mail_state          , :string ],
      [ :phone_change_date   , :string ],
      [ :photo_count         , :string ],
      [ :home_phone          , :string ],
      [ :mail_zip            , :string ],
      [ :phone_direct_office , :string ],
      [ :photo_date_modified , :string ]        
    ],
    CabooseRets::AgentMeta => [
      [ :la_code             , :string     ],
      [ :hide                , :boolean     , { :default => false }], 
      [ :bio                 , :text       ], 
      [ :contact_info        , :text       ], 
      [ :assistant_to        , :string     ],
      [ :designation         , :string     ],
      [ :image_location      , :string     ],
      [ :image               , :attachment ]
    ],
    CabooseRets::CommercialProperty => [
      [ :acreage                   , :text    ], 
      [ :adjoining_land_use        , :text    ], 
      [ :agent_notes               , :text    ], 
      [ :agent_other_contact_desc  , :text    ], 
      [ :agent_other_contact_phone , :text    ], 
      [ :annual_taxes              , :text    ], 
      [ :approx_age                , :text    ], 
      [ :area                      , :text    ],
      [ :banner                    , :text    ],
      [ :baths                     , :text    ], 
      [ :baths_full                , :text    ], 
      [ :baths_half                , :text    ], 
      [ :bedrooms                  , :text    ], 
      [ :bom_date                  , :text    ], 
      [ :book_number               , :text    ], 
      [ :book_page                 , :text    ], 
      [ :book_type                 , :text    ], 
      [ :box_on_unit               , :text    ], 
      [ :box_on_unit_yn            , :text    ], 
      [ :business_included_yn      , :text    ], 
      [ :buyer_broker              , :text    ], 
      [ :buyer_broker_type         , :text    ], 
      [ :buyer_city                , :text    ], 
      [ :buyer_name                , :text    ], 
      [ :buyer_state               , :text    ], 
      [ :buyer_zip                 , :text    ], 
      [ :category                  , :text    ], 
      [ :city                      , :text    ], 
      [ :city_code                 , :text    ], 
      [ :co_la_code                , :text    ], 
      [ :co_lo_code                , :text    ], 
      [ :co_sa_code                , :text    ], 
      [ :co_so_code                , :text    ], 
      [ :contacts                  , :text    ], 
      [ :contr_broker              , :text    ], 
      [ :contr_broker_type         , :text    ], 
      [ :county                    , :text    ], 
      [ :current_price             , :integer, { :default => 0 }], 
      [ :date_created              , :text    ],              
      [ :date_leased               , :text    ],              
      [ :date_modified             , :text    ],              
      [ :df_yn                     , :text    ],              
      [ :directions                , :text    ],              
      [ :display_address_yn        , :text    ],              
      [ :dom                       , :text    ],              
      [ :elem_school               , :text    ],              
      [ :expenses_assoc            , :text    ],              
      [ :expenses_ins              , :text    ],              
      [ :expenses_maint            , :text    ],              
      [ :expenses_mgmt             , :text    ],              
      [ :expenses_other            , :text    ],              
      [ :expenses_tax              , :text    ],              
      [ :expenses_utility          , :text    ],              
      [ :expire_date               , :text    ],              
      [ :flood_plain               , :text    ],              
      [ :ftr_building              , :text    ],              
      [ :ftr_building_type         , :text    ],              
      [ :ftr_closing               , :text    ],              
      [ :ftr_cooling               , :text    ],              
      [ :ftr_docs_on_file          , :text    ],              
      [ :ftr_exterior              , :text    ],              
      [ :ftr_financing             , :text    ],              
      [ :ftr_flooring              , :text    ],              
      [ :ftr_heating               , :text    ],              
      [ :ftr_interior              , :text    ],              
      [ :ftr_internet              , :text    ],              
      [ :ftr_lease_terms           , :text    ],              
      [ :ftr_property_desc         , :text    ],              
      [ :ftr_roof                  , :text    ],              
      [ :ftr_sale_terms            , :text    ],              
      [ :ftr_sewer                 , :text    ],              
      [ :ftr_showing               , :text    ],              
      [ :ftr_sprinkler             , :text    ],              
      [ :ftr_style                 , :text    ],              
      [ :ftr_utilities             , :text    ],              
      [ :ftr_utilities_rental      , :text    ],              
      [ :ftr_water                 , :text    ],              
      [ :geo_precision             , :text    ],              
      [ :georesult                 , :text    ],              
      [ :high_school               , :text    ],              
      [ :hoa_fee                   , :text    ],              
      [ :hoa_fee_yn                , :text    ],              
      [ :hoa_term                  , :text    ],              
      [ :income_gross              , :text    ],              
      [ :income_net                , :text    ],              
      [ :income_other              , :text    ],              
      [ :income_rental             , :text    ],              
      [ :internet_yn               , :text    ],              
      [ :la_code                   , :text    ],              
      [ :leased_through            , :text    ],              
      [ :legal_block               , :text    ],              
      [ :legal_lot                 , :text    ],              
      [ :legals                    , :text    ],              
      [ :list_date                 , :text    ],              
      [ :list_price                , :text    ],              
      [ :listing_type              , :text    ],              
      [ :lo_code                   , :text    ],              
      [ :lockbox_yn                , :text    ],              
      [ :lot_dimensions            , :text    ],              
      [ :lot_dimensions_source     , :text    ],              
      [ :media_flag                , :text    ],              
      [ :middle_school             , :text    ],              
      [ :mls_acct                  , :text    ],              
      [ :municipality              , :text    ],
      [ :negotiable_price          , :boolean ],
      [ :num_units                 , :text    ],              
      [ :num_units_occupied        , :text    ],              
      [ :off_mkt_date              , :text    ],              
      [ :off_mkt_days              , :text    ],              
      [ :office_notes              , :text    ],              
      [ :orig_lp                   , :text    ],              
      [ :other_fee                 , :text    ],              
      [ :other_fee_type            , :text    ],              
      [ :owner_name                , :text    ],              
      [ :owner_phone               , :text    ],              
      [ :parcel_id                 , :text    ],              
      [ :pending_date              , :text    ],              
      [ :photo_count               , :text    ],              
      [ :photo_date_modified       , :text    ],              
      [ :photo_description         , :text    ],              
      [ :photo_instr               , :text    ],              
      [ :posession                 , :text    ],              
      [ :price_change_date         , :text    ],              
      [ :price_sqft                , :text    ],              
      [ :proj_close_date           , :text    ],              
      [ :prop_desc                 , :text    ],              
      [ :prop_id                   , :text    ],              
      [ :prop_type                 , :text    ],              
      [ :remarks                   , :text    ],              
      [ :road_frontage_ft          , :text    ],              
      [ :sa_code                   , :text    ],              
      [ :sale_lease                , :text    ],              
      [ :sale_notes                , :text    ],              
      [ :so_code                   , :text    ],              
      [ :sold_date                 , :text    ],              
      [ :sold_price                , :text    ],              
      [ :sold_terms                , :text    ],              
      [ :sqft_source               , :text    ],              
      [ :state                     , :text    ],              
      [ :status                    , :text    ],              
      [ :status_date               , :text    ],              
      [ :status_flag               , :text    ],              
      [ :street                    , :text    ],              
      [ :street_dir                , :text    ],              
      [ :street_name               , :text    ],              
      [ :street_num                , :text    ],              
      [ :sub_agent                 , :text    ],              
      [ :sub_agent_type            , :text    ],              
      [ :sub_area                  , :text    ],              
      [ :subdivision               , :text    ],              
      [ :take_photo_yn             , :text    ],              
      [ :third_party_comm_yn       , :text    ],              
      [ :tot_heat_sqft             , :text    ],              
      [ :tour_date                 , :text    ],              
      [ :tour_submit_date          , :text    ],              
      [ :type_detailed             , :text    ],              
      [ :u1_dims                   , :text    ],              
      [ :u1_free_standing_yn       , :text    ],              
      [ :u1_sqft_manuf             , :text    ],              
      [ :u1_sqft_office            , :text    ],              
      [ :u1_sqft_retail            , :text    ],              
      [ :u1_sqft_total             , :text    ],              
      [ :u1_sqft_warehouse         , :text    ],              
      [ :u1_year_built             , :text    ],              
      [ :u2_dims                   , :text    ],              
      [ :u2_free_standing_yn       , :text    ],              
      [ :u2_sqft_manuf             , :text    ],              
      [ :u2_sqft_office            , :text    ],              
      [ :u2_sqft_retail            , :text    ],              
      [ :u2_sqft_total             , :text    ],              
      [ :u2_sqft_warehouse         , :text    ],              
      [ :u2_year_built             , :text    ],              
      [ :u3_dims                   , :text    ],              
      [ :u3_free_standing_yn       , :text    ],              
      [ :u3_sqft_manuf             , :text    ],              
      [ :u3_sqft_office            , :text    ],              
      [ :u3_sqft_retail            , :text    ],              
      [ :u3_sqft_total             , :text    ],              
      [ :u3_sqft_warehouse         , :text    ],              
      [ :u3_year_built             , :text    ],              
      [ :unit_num                  , :text    ],              
      [ :upload_source             , :text    ],              
      [ :vacancy_rate              , :text    ],              
      [ :vacant_yn                 , :text    ],              
      [ :valuation_yn              , :text    ],              
      [ :vt_yn                     , :text    ],              
      [ :waterfront_yn             , :text    ],              
      [ :withdrawn_date            , :text    ],              
      [ :year_built                , :text    ],              
      [ :zip                       , :text    ],              
      [ :zoning_northport          , :text    ],              
      [ :zoning_tusc               , :text    ],
      [ :latitude                  , :float ],  
      [ :longitude                 , :float ]  
    ],
    CabooseRets::LandProperty => [
      [ :acreage                   , :text ], 
      [ :acreage_source            , :text ], 
      [ :adjoining_land_use        , :text ], 
      [ :agent_notes               , :text ], 
      [ :agent_other_contact_desc  , :text ], 
      [ :agent_other_contact_phone , :text ], 
      [ :annual_taxes              , :text ], 
      [ :area                      , :text ], 
      [ :bom_date                  , :text ], 
      [ :book_number               , :text ], 
      [ :book_page                 , :text ], 
      [ :book_type                 , :text ], 
      [ :buyer_broker              , :text ], 
      [ :buyer_broker_type         , :text ], 
      [ :buyer_name                , :text ], 
      [ :category                  , :text ], 
      [ :city                      , :text ], 
      [ :city_code                 , :text ], 
      [ :co_la_code                , :text ], 
      [ :co_lo_code                , :text ], 
      [ :co_sa_code                , :text ], 
      [ :co_so_code                , :text ], 
      [ :contacts                  , :text ], 
      [ :contr_broker              , :text ], 
      [ :contr_broker_type         , :text ], 
      [ :converted                 , :text ], 
      [ :county                    , :text ], 
      [ :current_price             , :integer, { :default => 0 }], 
      [ :date_created              , :text ], 
      [ :date_modified             , :text ], 
      [ :df_yn                     , :text ], 
      [ :directions                , :text ], 
      [ :display_address_yn        , :text ], 
      [ :dom                       , :text ], 
      [ :elem_school               , :text ], 
      [ :expire_date               , :text ], 
      [ :ftr_access                , :text ], 
      [ :ftr_docs_on_file          , :text ], 
      [ :ftr_existing_struct       , :text ], 
      [ :ftr_extras                , :text ], 
      [ :ftr_internet              , :text ], 
      [ :ftr_lotdesc               , :text ], 
      [ :ftr_mineralrights         , :text ], 
      [ :ftr_possibleuse           , :text ], 
      [ :ftr_restrictions          , :text ], 
      [ :ftr_sewer                 , :text ], 
      [ :ftr_showing               , :text ], 
      [ :ftr_terms                 , :text ], 
      [ :ftr_topography            , :text ], 
      [ :ftr_utils                 , :text ], 
      [ :ftr_zoning                , :text ], 
      [ :geo_precision             , :text ], 
      [ :georesult                 , :text ], 
      [ :high_school               , :text ], 
      [ :internet_yn               , :text ], 
      [ :la_code                   , :text ], 
      [ :legal_block               , :text ], 
      [ :legal_lot                 , :text ], 
      [ :legal_section             , :text ], 
      [ :legals                    , :text ], 
      [ :list_date                 , :text ], 
      [ :list_price                , :text ], 
      [ :listing_type              , :text ], 
      [ :lo_code                   , :text ], 
      [ :lot_dim_source            , :text ], 
      [ :lot_dimensions            , :text ], 
      [ :media_flag                , :text ], 
      [ :middle_school             , :text ], 
      [ :mls_acct                  , :text ], 
      [ :municipality              , :text ], 
      [ :off_mkt_date              , :text ], 
      [ :off_mkt_days              , :text ], 
      [ :office_notes              , :text ], 
      [ :orig_lp                   , :text ], 
      [ :orig_price                , :text ], 
      [ :other_fee                 , :text ], 
      [ :other_fee_type            , :text ], 
      [ :owner_name                , :text ], 
      [ :owner_phone               , :text ], 
      [ :parcel_id                 , :text ], 
      [ :pending_date              , :text ], 
      [ :photo_count               , :text ], 
      [ :photo_date_modified       , :text ], 
      [ :price_change_date         , :text ], 
      [ :price_sqft                , :text ], 
      [ :proj_close_date           , :text ], 
      [ :prop_id                   , :text ], 
      [ :prop_type                 , :text ], 
      [ :remarks                   , :text ], 
      [ :road_frontage_ft          , :text ], 
      [ :sa_code                   , :text ], 
      [ :sale_lease                , :text ], 
      [ :sale_notes                , :text ], 
      [ :so_code                   , :text ], 
      [ :sold_date                 , :text ], 
      [ :sold_price                , :text ], 
      [ :sold_terms                , :text ], 
      [ :state                     , :text ], 
      [ :status                    , :text ], 
      [ :status_date               , :text ], 
      [ :status_flag               , :text ], 
      [ :street                    , :text ], 
      [ :street_dir                , :text ], 
      [ :street_name               , :text ], 
      [ :street_num                , :text ], 
      [ :sub_agent                 , :text ], 
      [ :sub_agent_type            , :text ], 
      [ :subdivision               , :text ], 
      [ :third_party_comm_yn       , :text ], 
      [ :unit_num                  , :text ], 
      [ :upload_source             , :text ], 
      [ :valuation_yn              , :text ], 
      [ :vt_yn                     , :text ], 
      [ :waterfront                , :text ], 
      [ :waterfront_yn             , :text ], 
      [ :wf_feet                   , :text ], 
      [ :withdrawn_date            , :text ], 
      [ :zip                       , :text ], 
      [ :zoning_northport          , :text ], 
      [ :zoning_tusc               , :text ], 
      [ :latitude                  , :float ], 
      [ :longitude                 , :float ]
    ],
    CabooseRets::Media => [ 
      [ :date_modified      , :string     ], 
      [ :file_name          , :string     ], 
      [ :media_id           , :string     ], 
      [ :media_order        , :integer     , { :default => 0 }], 
      [ :media_remarks      , :text       ], 
      [ :media_type         , :string     ], 
      [ :mls_acct           , :string     ], 
      [ :url                , :text       ],        
      [ :image              , :attachment ],
      [ :file               , :attachment ]    
    ],
    CabooseRets::MultiFamilyProperty => [
      [ :acreage                   , :text ], 
      [ :agent_notes               , :text ], 
      [ :agent_other_contact_desc  , :text ], 
      [ :agent_other_contact_phone , :text ], 
      [ :annual_taxes              , :text ], 
      [ :area                      , :text ], 
      [ :bom_date                  , :text ], 
      [ :book_number               , :text ], 
      [ :book_page                 , :text ], 
      [ :book_type                 , :text ], 
      [ :box_on_unit               , :text ], 
      [ :buyer_broker              , :text ], 
      [ :buyer_broker_type         , :text ], 
      [ :buyer_name                , :text ], 
      [ :category                  , :text ], 
      [ :city                      , :text ], 
      [ :city_code                 , :text ], 
      [ :contacts                  , :text ], 
      [ :contr_broker              , :text ], 
      [ :contr_broker_type         , :text ], 
      [ :county                    , :text ], 
      [ :co_la_code                , :text ], 
      [ :co_lo_code                , :text ], 
      [ :co_sa_code                , :text ], 
      [ :co_so_code                , :text ], 
      [ :current_price             , :integer ], 
      [ :date_created              , :text ], 
      [ :date_leased               , :text ], 
      [ :date_modified             , :text ], 
      [ :df_yn                     , :text ], 
      [ :directions                , :text ], 
      [ :display_address_yn        , :text ], 
      [ :dom                       , :text ], 
      [ :elem_school               , :text ], 
      [ :expenses_association      , :text ], 
      [ :expenses_insurance        , :text ], 
      [ :expenses_maintenance      , :text ], 
      [ :expenses_management       , :text ], 
      [ :expenses_other            , :text ], 
      [ :expenses_tax              , :text ], 
      [ :expire_date               , :text ], 
      [ :flood_plain               , :text ], 
      [ :ftr_building_type         , :text ], 
      [ :ftr_construction          , :text ], 
      [ :ftr_cooling               , :text ], 
      [ :ftr_exterior              , :text ], 
      [ :ftr_exterioramenit        , :text ], 
      [ :ftr_floors                , :text ], 
      [ :ftr_heating               , :text ], 
      [ :ftr_interior              , :text ], 
      [ :ftr_rent_incl             , :text ], 
      [ :ftr_roof                  , :text ], 
      [ :ftr_roof_age              , :text ], 
      [ :ftr_showing               , :text ], 
      [ :ftr_utils                 , :text ], 
      [ :ftr_zoning                , :text ], 
      [ :georesult                 , :text ], 
      [ :geo_precision             , :text ], 
      [ :high_school               , :text ], 
      [ :hoa_fee                   , :text ], 
      [ :hoa_fee_yn                , :text ], 
      [ :hoa_term                  , :text ], 
      [ :income                    , :text ], 
      [ :income_other              , :text ], 
      [ :income_rent               , :text ], 
      [ :internet_yn               , :text ], 
      [ :la_code                   , :text ], 
      [ :legals                    , :text ], 
      [ :limited_service_yn        , :text ], 
      [ :listing_type              , :text ], 
      [ :list_date                 , :text ], 
      [ :list_price                , :text ], 
      [ :lot_dimensions            , :text ], 
      [ :lot_dimensions_source     , :text ], 
      [ :lo_code                   , :text ], 
      [ :management                , :text ], 
      [ :media_flag                , :text ], 
      [ :middle_school             , :text ], 
      [ :mls_acct                  , :text ], 
      [ :municipality              , :text ], 
      [ :num_units                 , :text ], 
      [ :num_units_occupied        , :text ], 
      [ :office_notes              , :text ], 
      [ :off_mkt_date              , :text ], 
      [ :off_mkt_days              , :text ], 
      [ :orig_lp                   , :text ], 
      [ :orig_price                , :text ], 
      [ :other_fee                 , :text ], 
      [ :other_fee_type            , :text ], 
      [ :owner_name                , :text ], 
      [ :owner_phone               , :text ], 
      [ :parcel_id                 , :text ], 
      [ :pending_date              , :text ], 
      [ :photo_count               , :text ], 
      [ :photo_date_modified       , :text ], 
      [ :price_change_date         , :text ], 
      [ :price_sqft                , :text ], 
      [ :proj_close_date           , :text ], 
      [ :prop_id                   , :text ], 
      [ :prop_type                 , :text ], 
      [ :remarks                   , :text ], 
      [ :sale_notes                , :text ], 
      [ :sale_rent                 , :text ], 
      [ :sa_code                   , :text ], 
      [ :sold_date                 , :text ], 
      [ :sold_price                , :text ], 
      [ :sold_terms                , :text ], 
      [ :so_code                   , :text ], 
      [ :state                     , :text ], 
      [ :status                    , :text ], 
      [ :status_date               , :text ], 
      [ :status_flag               , :text ], 
      [ :street                    , :text ], 
      [ :street_dir                , :text ], 
      [ :street_name               , :text ], 
      [ :street_num                , :text ], 
      [ :subdivision               , :text ], 
      [ :sub_agent                 , :text ], 
      [ :sub_agent_type            , :text ], 
      [ :third_party_comm_yn       , :text ], 
      [ :tot_heat_sqft             , :text ], 
      [ :u1_baths                  , :text ], 
      [ :u1_num                    , :text ], 
      [ :u1_occ                    , :text ], 
      [ :u1_rent                   , :text ], 
      [ :u1_sqft                   , :text ], 
      [ :u1_yn                     , :text ], 
      [ :u2_baths                  , :text ], 
      [ :u2_num                    , :text ], 
      [ :u2_occ                    , :text ], 
      [ :u2_rent                   , :text ], 
      [ :u2_sqft                   , :text ], 
      [ :u2_yn                     , :text ], 
      [ :u3_baths                  , :text ], 
      [ :u3_num                    , :text ], 
      [ :u3_occ                    , :text ], 
      [ :u3_rent                   , :text ], 
      [ :u3_sqft                   , :text ], 
      [ :u3_yn                     , :text ], 
      [ :u4_baths                  , :text ], 
      [ :u4_num                    , :text ], 
      [ :u4_occ                    , :text ], 
      [ :u4_rent                   , :text ], 
      [ :u4_sqft                   , :text ], 
      [ :u4_yn                     , :text ], 
      [ :u5_baths                  , :text ], 
      [ :u5_num                    , :text ], 
      [ :u5_occ                    , :text ], 
      [ :u5_rent                   , :text ], 
      [ :u5_sqft                   , :text ], 
      [ :u5_yn                     , :text ], 
      [ :u6_baths                  , :text ], 
      [ :u6_num                    , :text ], 
      [ :u6_occ                    , :text ], 
      [ :u6_rent                   , :text ], 
      [ :u6_sqft                   , :text ], 
      [ :u6_yn                     , :text ], 
      [ :u7_baths                  , :text ], 
      [ :u7_num                    , :text ], 
      [ :u7_occ                    , :text ], 
      [ :u7_rent                   , :text ], 
      [ :u7_sqft                   , :text ], 
      [ :u7_yn                     , :text ], 
      [ :u8_num                    , :text ], 
      [ :u8_occ                    , :text ], 
      [ :u8_rent                   , :text ], 
      [ :u8_sqft                   , :text ], 
      [ :u8_yn                     , :text ], 
      [ :unit_num                  , :text ], 
      [ :upload_source             , :text ], 
      [ :valuation_yn              , :text ], 
      [ :vt_yn                     , :text ], 
      [ :withdrawn_date            , :text ], 
      [ :year_built                , :text ], 
      [ :zip                       , :text ], 
      [ :latitude                  , :float ], 
      [ :longitude                 , :float ] 
    ],
    CabooseRets::Office => [
      [ :lo_date_created     , :string ], 
      [ :lo_date_modified    , :string ], 
      [ :lo_email            , :string ], 
      [ :lo_fax_phone        , :string ], 
      [ :lo_idx_yn           , :string ], 
      [ :lo_code             , :string ], 
      [ :lo_mailaddr1        , :string ], 
      [ :lo_mailaddr2        , :string ], 
      [ :lo_mailcity         , :string ], 
      [ :lo_mailstate        , :string ], 
      [ :lo_mailzip          , :string ], 
      [ :lo_main_lo_code     , :string ], 
      [ :lo_name             , :string ], 
      [ :lo_other_phone      , :string ], 
      [ :lo_page             , :string ], 
      [ :lo_phone            , :string ], 
      [ :lo_status           , :string ], 
      [ :photo_count         , :string ], 
      [ :photo_date_modified , :string ] 
    ],
    CabooseRets::OfficeMeta => [
      [ :lo_code , :string     ],
      [ :image   , :attachment ]
    ],
    CabooseRets::OpenHouse => [
      [ :comments        , :string ], 
      [ :date_created    , :string ], 
      [ :date_modified   , :string ], 
      [ :end_time        , :string ], 
      [ :la_code         , :string ], 
      [ :mls_acct        , :string ], 
      [ :open_house_date , :string ], 
      [ :open_house_type , :string ], 
      [ :perpetual_yn    , :string ], 
      [ :prop_type       , :string ], 
      [ :start_time      , :string ] 
    ],
    CabooseRets::ResidentialProperty => [
      [ :bedrooms                       , :text ], 
      [ :dom                            , :text ], 
      [ :ftr_pool                       , :text ], 
      [ :rm_other3_desc                 , :text ], 
      [ :baths_full                     , :text ], 
      [ :ftr_diningroom                 , :text ], 
      [ :ftr_porchpatio                 , :text ], 
      [ :rm_other3_name                 , :text ], 
      [ :baths_half                     , :text ], 
      [ :directions                     , :text ], 
      [ :ftr_possession                 , :text ], 
      [ :rm_other4                      , :text ], 
      [ :baths                          , :text ], 
      [ :display_address_yn             , :text ], 
      [ :current_price                  , :integer, { :default => 0 }], 
      [ :rm_other4_desc                 , :text ], 
      [ :avm_automated_sales_disabled   , :text ], 
      [ :ftr_drive                      , :text ], 
      [ :price_change_date              , :text ], 
      [ :rm_other4_name                 , :text ], 
      [ :avm_instant_valuation_disabled , :text ], 
      [ :elem_school                    , :text ], 
      [ :price_sqft                     , :text ], 
      [ :rm_recrm                       , :text ], 
      #[ :acreage                        , :text ],
      [ :acreage                        , :float, { :default => 0.0 }],
      #[ :acreage_temp                   , :float, { :default => 0.0 }],
      [ :expire_date                    , :text ], 
      [ :prop_type                      , :text ], 
      [ :rm_recrm_desc                  , :text ], 
      [ :ftr_age                        , :text ], 
      [ :ftr_exterior                   , :text ], 
      [ :rm_bath1                       , :text ], 
      [ :rm_study                       , :text ], 
      [ :agent_notes                    , :text ], 
      [ :ftr_citycommunit               , :text ], 
      [ :rm_bath1_desc                  , :text ], 
      [ :rm_study_desc                  , :text ], 
      [ :agent_other_contact_desc       , :text ], 
      [ :ftr_fireplace                  , :text ], 
      [ :rm_bath2                       , :text ], 
      [ :rm_sun                         , :text ], 
      [ :agent_other_contact_phone      , :text ], 
      [ :flood_plain                    , :text ], 
      [ :rm_bath2_desc                  , :text ], 
      [ :rm_sun_desc                    , :text ], 
      [ :annual_taxes                   , :text ], 
      [ :foreclosure_yn                 , :text ], 
      [ :rm_bath3                       , :text ], 
      [ :remarks                        , :text ], 
      [ :internet_yn                    , :text ], 
      [ :georesult                      , :text ], 
      [ :rm_bath3_desc                  , :text ], 
      [ :right_red_date                 , :text ], 
      [ :ftr_appliances                 , :text ], 
      [ :ftr_garage                     , :text ], 
      [ :rm_br1                         , :text ], 
      [ :ftr_roof                       , :text ], 
      [ :tot_heat_sqft                  , :text ], 
      [ :geo_precision                  , :text ], 
      [ :rm_br1_desc                    , :text ], 
      [ :status_flag                    , :text ], 
      [ :area                           , :text ], 
      [ :ftr_hoaamenities               , :text ], 
      [ :rm_br2                         , :text ], 
      [ :hoa_fee                        , :text ], 
      [ :ftr_hoaincludes                , :text ], 
      [ :rm_br2_desc                    , :text ], 
      [ :sale_notes                     , :text ], 
      [ :hoa_term                       , :text ], 
      [ :hoa_fee_yn                     , :text ], 
      [ :rm_br3                         , :text ], 
      [ :ftr_terms                      , :text ], 
      [ :ftr_attic                      , :text ], 
      [ :ftr_heating                    , :text ], 
      [ :rm_br3_desc                    , :text ], 
      [ :sale_lease                     , :text ], 
      [ :ftr_docs_on_file               , :text ], 
      [ :high_school                    , :text ], 
      [ :rm_br4                         , :text ], 
      [ :owner_name                     , :text ], 
      [ :bom_date                       , :text ], 
      [ :homestead_yn                   , :text ], 
      [ :rm_br4_desc                    , :text ], 
      [ :owner_phone                    , :text ], 
      [ :basement_yn                    , :text ], 
      [ :ftr_interior                   , :text ], 
      [ :rm_br5                         , :text ], 
      [ :sa_code                        , :text ], 
      [ :ftr_basement                   , :text ], 
      [ :lease_exp_date                 , :text ], 
      [ :rm_br5_desc                    , :text ], 
      [ :so_code                        , :text ], 
      [ :book_number                    , :text ], 
      [ :ftr_landscaping                , :text ], 
      [ :rm_brkfst                      , :text ], 
      [ :ftr_sewer                      , :text ], 
      [ :book_page                      , :text ], 
      [ :ftr_laundry                    , :text ], 
      [ :rm_brkfst_desc                 , :text ], 
      [ :ftr_showing                    , :text ], 
      [ :book_type                      , :text ], 
      [ :legals                         , :text ], 
      [ :rm_den                         , :text ], 
      [ :sold_date                      , :text ], 
      [ :buyer_name                     , :text ], 
      [ :levels                         , :text ], 
      [ :rm_den_desc                    , :text ], 
      [ :sold_price                     , :text ], 
      [ :city_code                      , :text ], 
      [ :list_price                     , :text ], 
      [ :rm_dining                      , :text ], 
      [ :sold_terms                     , :text ], 
      [ :converted                      , :text ], 
      [ :list_date                      , :text ], 
      [ :rm_dining_desc                 , :text ], 
      [ :sqft_source                    , :text ], 
      [ :currentlease_yn                , :text ], 
      [ :status                         , :text ], 
      [ :rm_family                      , :text ], 
      [ :state                          , :text ], 
      [ :category                       , :text ], 
      [ :listing_type                   , :text ], 
      [ :rm_family_desc                 , :text ], 
      [ :street_dir                     , :text ], 
      [ :city                           , :text ], 
      [ :la_code                        , :text ], 
      [ :rm_foyer                       , :text ], 
      [ :street_name                    , :text ], 
      [ :co_la_code                     , :text ], 
      [ :lo_code                        , :text ], 
      [ :rm_foyer_desc                  , :text ], 
      [ :street_num                     , :text ], 
      [ :co_lo_code                     , :text ], 
      [ :ftr_lotdesc                    , :text ], 
      [ :rm_great                       , :text ], 
      [ :style                          , :text ], 
      [ :co_so_code                     , :text ], 
      [ :lot_dimensions                 , :text ], 
      [ :rm_great_desc                  , :text ], 
      [ :subdivision                    , :text ], 
      [ :co_sa_code                     , :text ], 
      [ :mls_acct                       , :text ], 
      [ :rm_kitchen                     , :text ], 
      [ :take_photo_yn                  , :text ], 
      [ :buyer_broker                   , :text ], 
      [ :master_bed_lvl                 , :text ], 
      [ :rm_kitchen2                    , :text ], 
      [ :upload_source                  , :text ], 
      [ :buyer_broker_type              , :text ], 
      [ :middle_school                  , :text ], 
      [ :rm_kitchen2_desc               , :text ], 
      [ :unit_num                       , :text ], 
      [ :sub_agent                      , :text ], 
      [ :ftr_miscellaneous              , :text ], 
      [ :rm_kitchen_desc                , :text ], 
      [ :valuation_yn                   , :text ], 
      [ :sub_agent_type                 , :text ], 
      [ :other_fee                      , :text ], 
      [ :rm_laundry                     , :text ], 
      [ :third_party_comm_yn            , :text ], 
      [ :contr_broker                   , :text ], 
      [ :off_mkt_date                   , :text ], 
      [ :rm_laundry_desc                , :text ], 
      [ :vt_yn                          , :text ], 
      [ :contr_broker_type              , :text ], 
      [ :off_mkt_days                   , :text ], 
      [ :rm_living                      , :text ], 
      [ :ftr_warrantyprogrm             , :text ], 
      [ :construction_date_comp         , :text ], 
      [ :outlier_yn                     , :text ], 
      [ :rm_living_desc                 , :text ], 
      [ :wf_feet                        , :text ], 
      [ :ftr_construction               , :text ], 
      [ :office_notes                   , :text ], 
      [ :rm_lrdr                        , :text ], 
      [ :ftr_waterheater                , :text ], 
      [ :construction_status            , :text ], 
      [ :onsite_yn                      , :text ], 
      [ :rm_lrdr_desc                   , :text ], 
      [ :ftr_watersupply                , :text ], 
      [ :contacts                       , :text ], 
      [ :onsite_days_hours              , :text ], 
      [ :rm_master                      , :text ], 
      [ :waterfront                     , :text ], 
      [ :ftr_cooling                    , :text ], 
      [ :orig_lp                        , :text ], 
      [ :rm_master_desc                 , :text ], 
      [ :ftr_window_treat               , :text ], 
      [ :county                         , :text ], 
      [ :other_fee_type                 , :text ], 
      [ :rm_other1                      , :text ], 
      [ :ftr_windows                    , :text ], 
      [ :df_yn                          , :text ], 
      [ :photo_count                    , :text ], 
      [ :rm_other1_desc                 , :text ], 
      [ :year_built                     , :text ], 
      [ :date_modified                  , :text ], 
      [ :photo_date_modified            , :text ], 
      [ :rm_other1_name                 , :text ], 
      [ :year_built_source              , :text ], 
      [ :status_date                    , :text ], 
      [ :prop_id                        , :text ], 
      [ :rm_other2                      , :text ], 
      [ :zip                            , :text ], 
      [ :date_created                   , :text ], 
      [ :parcel_id                      , :text ], 
      [ :rm_other2_desc                 , :text ], 
      [ :proj_close_date                , :text ], 
      [ :pending_date                   , :text ], 
      [ :rm_other2_name                 , :text ], 
      [ :withdrawn_date                 , :text ], 
      [ :media_flag                     , :text ], 
      [ :rm_other3                      , :text ],         
      [ :latitude                       , :float ], 
      [ :longitude                      , :float ]       
    ],
    CabooseRets::SavedProperty => [
      [ :user_id  , :integer ],
      [ :mls_acct , :integer ]
    ],
    CabooseRets::SavedSearch => [
      [ :user_id       , :integer   ], 
      [ :params        , :text      ], 
      [ :date_created  , :timestamp ], 
      [ :date_last     , :timestamp ], 
      [ :interval      , :integer   ], 
      [ :property_type , :string    ],
      [ :uri           , :text      ], 
      [ :notify        , :boolean   ] 
    ],
    CabooseRets::SearchOption => [
      [ :name            , :string ],
      [ :field           , :string ],
      [ :value           , :string ],
      [ :flag_for_delete , :boolean , { :default => false }]
    ],
    Caboose::Site => [
      [ :use_rets , :boolean, { :default => false }]        
    ]
  }
end