ruian 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +2 -0
  7. data/example/.gitignore +15 -0
  8. data/example/Gemfile +28 -0
  9. data/example/README.md +23 -0
  10. data/example/Rakefile +7 -0
  11. data/example/app/assets/images/rails.png +0 -0
  12. data/example/app/assets/javascripts/application.js +13 -0
  13. data/example/app/assets/stylesheets/application.css +13 -0
  14. data/example/app/controllers/application_controller.rb +3 -0
  15. data/example/app/helpers/application_helper.rb +2 -0
  16. data/example/app/mailers/.gitkeep +0 -0
  17. data/example/app/models/.gitkeep +0 -0
  18. data/example/app/models/address.rb +5 -0
  19. data/example/app/models/address/city.rb +7 -0
  20. data/example/app/models/address/city_part.rb +7 -0
  21. data/example/app/models/address/county.rb +3 -0
  22. data/example/app/models/address/county_name_count.rb +7 -0
  23. data/example/app/models/address/momc_name.rb +5 -0
  24. data/example/app/models/address/mop_name.rb +5 -0
  25. data/example/app/models/address/name.rb +18 -0
  26. data/example/app/models/address/name_type.rb +6 -0
  27. data/example/app/models/address/place.rb +13 -0
  28. data/example/app/models/address/region.rb +3 -0
  29. data/example/app/models/address/region_name_count.rb +7 -0
  30. data/example/app/models/address/street_name.rb +5 -0
  31. data/example/app/views/layouts/application.html.erb +14 -0
  32. data/example/config.ru +4 -0
  33. data/example/config/application.rb +63 -0
  34. data/example/config/boot.rb +6 -0
  35. data/example/config/database.yml +25 -0
  36. data/example/config/environment.rb +5 -0
  37. data/example/config/environments/development.rb +32 -0
  38. data/example/config/environments/production.rb +54 -0
  39. data/example/config/environments/test.rb +37 -0
  40. data/example/config/initializers/backtrace_silencers.rb +7 -0
  41. data/example/config/initializers/inflections.rb +15 -0
  42. data/example/config/initializers/mime_types.rb +5 -0
  43. data/example/config/initializers/secret_token.rb +7 -0
  44. data/example/config/initializers/session_store.rb +8 -0
  45. data/example/config/initializers/wrap_parameters.rb +14 -0
  46. data/example/config/locales/en.yml +5 -0
  47. data/example/config/routes.rb +58 -0
  48. data/example/db/migrate/20140418190407_create_tables.rb +170 -0
  49. data/example/db/schema.rb +182 -0
  50. data/example/db/seeds.rb +7 -0
  51. data/example/lib/assets/.gitkeep +0 -0
  52. data/example/lib/importer.rb +163 -0
  53. data/example/lib/tasks/.gitkeep +0 -0
  54. data/example/lib/tasks/ruian.rake +4 -0
  55. data/example/log/.gitkeep +0 -0
  56. data/example/public/404.html +26 -0
  57. data/example/public/422.html +26 -0
  58. data/example/public/500.html +25 -0
  59. data/example/public/favicon.ico +0 -0
  60. data/example/public/index.html +241 -0
  61. data/example/public/robots.txt +5 -0
  62. data/example/script/rails +6 -0
  63. data/example/vendor/assets/javascripts/.gitkeep +0 -0
  64. data/example/vendor/assets/stylesheets/.gitkeep +0 -0
  65. data/example/vendor/plugins/.gitkeep +0 -0
  66. data/fixtures/counties.csv +92 -0
  67. data/fixtures/vazby-cr.csv +15072 -0
  68. data/fixtures/vazby-okresy-cr.csv +15072 -0
  69. data/lib/ruian.rb +86 -0
  70. data/lib/ruian/enum_updater.rb +59 -0
  71. data/lib/ruian/fetcher.rb +71 -0
  72. data/lib/ruian/files_updater.rb +54 -0
  73. data/lib/ruian/importer.rb +21 -0
  74. data/lib/ruian/model.rb +10 -0
  75. data/lib/ruian/model/county.rb +6 -0
  76. data/lib/ruian/model/county_integration.rb +6 -0
  77. data/lib/ruian/model/region.rb +6 -0
  78. data/lib/ruian/model/region_integration.rb +6 -0
  79. data/lib/ruian/model/row.rb +9 -0
  80. data/lib/ruian/parser.rb +12 -0
  81. data/lib/ruian/queue.rb +24 -0
  82. data/lib/ruian/railtie.rb +9 -0
  83. data/lib/ruian/tasks/ruian.rake +18 -0
  84. data/lib/ruian/version.rb +3 -0
  85. data/ruian.gemspec +26 -0
  86. metadata +198 -0
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Example::Application.initialize!
@@ -0,0 +1,32 @@
1
+ Example::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Raise exception on mass assignment protection for Active Record models
26
+ config.active_record.mass_assignment_sanitizer = :strict
27
+
28
+ # Log the query plan for queries taking more than this (works
29
+ # with SQLite, MySQL, and PostgreSQL)
30
+ config.active_record.auto_explain_threshold_in_seconds = 0.5
31
+
32
+ end
@@ -0,0 +1,54 @@
1
+ Example::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+
15
+ # Specifies the header that your server uses for sending files
16
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
17
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
18
+
19
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
20
+ # config.force_ssl = true
21
+
22
+ # See everything in the log (default is :info)
23
+ # config.log_level = :debug
24
+
25
+ # Prepend all log lines with the following tags
26
+ # config.log_tags = [ :subdomain, :uuid ]
27
+
28
+ # Use a different logger for distributed setups
29
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
30
+
31
+ # Use a different cache store in production
32
+ # config.cache_store = :mem_cache_store
33
+
34
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+
38
+ # Disable delivery errors, bad email addresses will be ignored
39
+ # config.action_mailer.raise_delivery_errors = false
40
+
41
+ # Enable threaded mode
42
+ # config.threadsafe!
43
+
44
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
45
+ # the I18n.default_locale when a translation can not be found)
46
+ config.i18n.fallbacks = true
47
+
48
+ # Send deprecation notices to registered listeners
49
+ config.active_support.deprecation = :notify
50
+
51
+ # Log the query plan for queries taking more than this (works
52
+ # with SQLite, MySQL, and PostgreSQL)
53
+ # config.active_record.auto_explain_threshold_in_seconds = 0.5
54
+ end
@@ -0,0 +1,37 @@
1
+ Example::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Example::Application.config.secret_token = '08086047a7724d3c57ec067e79b99d4ed5ba1b859074b72bc28703dc6abd0cb38edef52f8d5da8108fdd72ddc0f42589dd5680a38dc101f4a7f8b4ba97665a78'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Example::Application.config.session_store :cookie_store, key: '_example_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Example::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,58 @@
1
+ Example::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => 'welcome#index'
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id))(.:format)'
58
+ end
@@ -0,0 +1,170 @@
1
+ class CreateTables < ActiveRecord::Migration
2
+ def change
3
+ create_table "address_cities", :force => true do |t|
4
+ t.integer "code", :null => false
5
+ t.string "name", :null => false
6
+ t.integer "county_id"
7
+ t.integer "region_id"
8
+ t.datetime "created_at", :null => false
9
+ t.datetime "updated_at", :null => false
10
+ end
11
+
12
+ add_index "address_cities", ["code"], :name => "index_address_cities_on_code"
13
+ add_index "address_cities", ["county_id"], :name => "index_address_cities_on_county_id"
14
+ add_index "address_cities", ["region_id"], :name => "index_address_cities_on_region_id"
15
+
16
+ create_table "address_city_parts", :force => true do |t|
17
+ t.integer "code", :null => false
18
+ t.string "name", :null => false
19
+ t.integer "city_id", :null => false
20
+ t.datetime "created_at", :null => false
21
+ t.datetime "updated_at", :null => false
22
+ end
23
+
24
+ add_index "address_city_parts", ["city_id"], :name => "index_address_city_parts_on_city_id"
25
+
26
+ create_table "address_counties", :force => true do |t|
27
+ t.integer "code"
28
+ t.string "name"
29
+ t.datetime "created_at", :null => false
30
+ t.datetime "updated_at", :null => false
31
+ end
32
+
33
+ create_table "address_county_name_counts", :force => true do |t|
34
+ t.integer "county_id", :null => false
35
+ t.integer "name_id", :null => false
36
+ t.integer "count", :default => 0, :null => false
37
+ end
38
+
39
+ add_index "address_county_name_counts", ["county_id"], :name => "index_address_county_name_counts_on_county_id"
40
+ add_index "address_county_name_counts", ["name_id"], :name => "index_address_county_name_counts_on_name_id"
41
+
42
+ create_table "address_momc_names", :force => true do |t|
43
+ t.string "name", :null => false
44
+ t.datetime "created_at", :null => false
45
+ t.datetime "updated_at", :null => false
46
+ end
47
+
48
+ create_table "address_mop_names", :force => true do |t|
49
+ t.string "name", :null => false
50
+ t.datetime "created_at", :null => false
51
+ t.datetime "updated_at", :null => false
52
+ end
53
+
54
+ create_table "address_names", :force => true do |t|
55
+ t.string "name", :null => false
56
+ t.integer "type", :null => false
57
+ t.datetime "created_at", :null => false
58
+ t.datetime "updated_at", :null => false
59
+ end
60
+
61
+ create_table "address_places", :force => true do |t|
62
+ t.integer "e"
63
+ t.integer "p"
64
+ t.string "o"
65
+ t.string "zip"
66
+ t.integer "code", :null => false
67
+ t.integer "street_name_id"
68
+ t.integer "mop_name_id"
69
+ t.integer "momc_name_id"
70
+ t.integer "city_id"
71
+ t.integer "city_part_id"
72
+ t.float "longitude"
73
+ t.float "latitude"
74
+ t.datetime "created_at", :null => false
75
+ t.datetime "updated_at", :null => false
76
+ t.boolean "imported", :default => false, :null => false
77
+ end
78
+
79
+ add_index "address_places", ["city_id"], :name => "index_address_places_on_city_id"
80
+ add_index "address_places", ["city_part_id"], :name => "index_address_places_on_city_part_id"
81
+ add_index "address_places", ["code"], :name => "index_address_places_on_code"
82
+ add_index "address_places", ["momc_name_id"], :name => "index_address_places_on_momc_name_id"
83
+ add_index "address_places", ["mop_name_id"], :name => "index_address_places_on_mop_name_id"
84
+ add_index "address_places", ["street_name_id"], :name => "index_address_places_on_street_name_id"
85
+
86
+ create_table "address_regex_indices", :force => true do |t|
87
+ t.string "target_table"
88
+ t.integer "target_id"
89
+ t.string "regex"
90
+ t.datetime "created_at", :null => false
91
+ t.datetime "updated_at", :null => false
92
+ end
93
+
94
+ add_index "address_regex_indices", ["target_id"], :name => "index_address_regex_indices_on_target_id"
95
+
96
+ create_table "address_region_name_counts", :force => true do |t|
97
+ t.integer "region_id", :null => false
98
+ t.integer "name_id", :null => false
99
+ t.integer "count", :default => 0, :null => false
100
+ end
101
+
102
+ add_index "address_region_name_counts", ["name_id"], :name => "index_address_region_name_counts_on_name_id"
103
+ add_index "address_region_name_counts", ["region_id"], :name => "index_address_region_name_counts_on_region_id"
104
+
105
+ create_table "address_regions", :force => true do |t|
106
+ t.integer "ruian_code"
107
+ t.string "ruian_name"
108
+ t.datetime "created_at", :null => false
109
+ t.datetime "updated_at", :null => false
110
+ t.integer "mvcr_code"
111
+ t.string "mvcr_name"
112
+ end
113
+
114
+ create_table "address_street_names", :force => true do |t|
115
+ t.string "name", :null => false
116
+ t.datetime "created_at", :null => false
117
+ t.datetime "updated_at", :null => false
118
+ end
119
+
120
+ create_table "contract_requests", :force => true do |t|
121
+ t.string "token", :null => false
122
+ t.integer "original_supplier_id"
123
+ t.text "input_data"
124
+ t.text "output_data"
125
+ t.integer "status", :default => 1, :null => false
126
+ t.text "status_message"
127
+ t.datetime "created_at", :null => false
128
+ t.datetime "updated_at", :null => false
129
+ end
130
+
131
+ add_index "contract_requests", ["original_supplier_id"], :name => "index_contract_requests_on_original_supplier_id"
132
+
133
+ create_table "contract_scans", :force => true do |t|
134
+ t.integer "request_id"
135
+ t.string "image_file_name"
136
+ t.string "image_content_type"
137
+ t.integer "image_file_size"
138
+ t.datetime "image_updated_at"
139
+ t.datetime "created_at", :null => false
140
+ t.datetime "updated_at", :null => false
141
+ t.integer "status", :default => 1, :null => false
142
+ t.text "output"
143
+ t.text "ocr_params"
144
+ end
145
+
146
+ add_index "contract_scans", ["request_id"], :name => "index_contract_scans_on_request_id"
147
+
148
+ create_table "contract_suppliers", :force => true do |t|
149
+ t.string "name"
150
+ t.string "code"
151
+ t.datetime "created_at", :null => false
152
+ t.datetime "updated_at", :null => false
153
+ t.text "ocr_params"
154
+ end
155
+
156
+ create_table "vehicle_manufacturer", :id => false, :force => true do |t|
157
+ t.integer "id"
158
+ t.string "manufacturer", :null => false
159
+ end
160
+
161
+ create_table "vehicle_model", :id => false, :force => true do |t|
162
+ t.string "code", :null => false
163
+ t.string "model", :null => false
164
+ t.integer "internal_id"
165
+ t.integer "manufacturer_id"
166
+ t.boolean "insurance", :default => false, :null => false
167
+ end
168
+
169
+ end
170
+ end
@@ -0,0 +1,182 @@
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
+
14
+ ActiveRecord::Schema.define(:version => 20140418190407) do
15
+
16
+ create_table "address_cities", :force => true do |t|
17
+ t.integer "code", :null => false
18
+ t.string "name", :null => false
19
+ t.integer "county_id"
20
+ t.integer "region_id"
21
+ t.datetime "created_at", :null => false
22
+ t.datetime "updated_at", :null => false
23
+ end
24
+
25
+ add_index "address_cities", ["code"], :name => "index_address_cities_on_code"
26
+ add_index "address_cities", ["county_id"], :name => "index_address_cities_on_county_id"
27
+ add_index "address_cities", ["region_id"], :name => "index_address_cities_on_region_id"
28
+
29
+ create_table "address_city_parts", :force => true do |t|
30
+ t.integer "code", :null => false
31
+ t.string "name", :null => false
32
+ t.integer "city_id", :null => false
33
+ t.datetime "created_at", :null => false
34
+ t.datetime "updated_at", :null => false
35
+ end
36
+
37
+ add_index "address_city_parts", ["city_id"], :name => "index_address_city_parts_on_city_id"
38
+
39
+ create_table "address_counties", :force => true do |t|
40
+ t.integer "code"
41
+ t.string "name"
42
+ t.datetime "created_at", :null => false
43
+ t.datetime "updated_at", :null => false
44
+ end
45
+
46
+ create_table "address_county_name_counts", :force => true do |t|
47
+ t.integer "county_id", :null => false
48
+ t.integer "name_id", :null => false
49
+ t.integer "count", :default => 0, :null => false
50
+ end
51
+
52
+ add_index "address_county_name_counts", ["county_id"], :name => "index_address_county_name_counts_on_county_id"
53
+ add_index "address_county_name_counts", ["name_id"], :name => "index_address_county_name_counts_on_name_id"
54
+
55
+ create_table "address_momc_names", :force => true do |t|
56
+ t.string "name", :null => false
57
+ t.datetime "created_at", :null => false
58
+ t.datetime "updated_at", :null => false
59
+ end
60
+
61
+ create_table "address_mop_names", :force => true do |t|
62
+ t.string "name", :null => false
63
+ t.datetime "created_at", :null => false
64
+ t.datetime "updated_at", :null => false
65
+ end
66
+
67
+ create_table "address_names", :force => true do |t|
68
+ t.string "name", :null => false
69
+ t.integer "type", :null => false
70
+ t.datetime "created_at", :null => false
71
+ t.datetime "updated_at", :null => false
72
+ end
73
+
74
+ create_table "address_places", :force => true do |t|
75
+ t.integer "e"
76
+ t.integer "p"
77
+ t.string "o"
78
+ t.string "zip"
79
+ t.integer "code", :null => false
80
+ t.integer "street_name_id"
81
+ t.integer "mop_name_id"
82
+ t.integer "momc_name_id"
83
+ t.integer "city_id"
84
+ t.integer "city_part_id"
85
+ t.float "longitude"
86
+ t.float "latitude"
87
+ t.datetime "created_at", :null => false
88
+ t.datetime "updated_at", :null => false
89
+ t.boolean "imported", :default => false, :null => false
90
+ end
91
+
92
+ add_index "address_places", ["city_id"], :name => "index_address_places_on_city_id"
93
+ add_index "address_places", ["city_part_id"], :name => "index_address_places_on_city_part_id"
94
+ add_index "address_places", ["code"], :name => "index_address_places_on_code"
95
+ add_index "address_places", ["momc_name_id"], :name => "index_address_places_on_momc_name_id"
96
+ add_index "address_places", ["mop_name_id"], :name => "index_address_places_on_mop_name_id"
97
+ add_index "address_places", ["street_name_id"], :name => "index_address_places_on_street_name_id"
98
+
99
+ create_table "address_regex_indices", :force => true do |t|
100
+ t.string "target_table"
101
+ t.integer "target_id"
102
+ t.string "regex"
103
+ t.datetime "created_at", :null => false
104
+ t.datetime "updated_at", :null => false
105
+ end
106
+
107
+ add_index "address_regex_indices", ["target_id"], :name => "index_address_regex_indices_on_target_id"
108
+
109
+ create_table "address_region_name_counts", :force => true do |t|
110
+ t.integer "region_id", :null => false
111
+ t.integer "name_id", :null => false
112
+ t.integer "count", :default => 0, :null => false
113
+ end
114
+
115
+ add_index "address_region_name_counts", ["name_id"], :name => "index_address_region_name_counts_on_name_id"
116
+ add_index "address_region_name_counts", ["region_id"], :name => "index_address_region_name_counts_on_region_id"
117
+
118
+ create_table "address_regions", :force => true do |t|
119
+ t.integer "ruian_code"
120
+ t.string "ruian_name"
121
+ t.datetime "created_at", :null => false
122
+ t.datetime "updated_at", :null => false
123
+ t.integer "mvcr_code"
124
+ t.string "mvcr_name"
125
+ end
126
+
127
+ create_table "address_street_names", :force => true do |t|
128
+ t.string "name", :null => false
129
+ t.datetime "created_at", :null => false
130
+ t.datetime "updated_at", :null => false
131
+ end
132
+
133
+ create_table "contract_requests", :force => true do |t|
134
+ t.string "token", :null => false
135
+ t.integer "original_supplier_id"
136
+ t.text "input_data"
137
+ t.text "output_data"
138
+ t.integer "status", :default => 1, :null => false
139
+ t.text "status_message"
140
+ t.datetime "created_at", :null => false
141
+ t.datetime "updated_at", :null => false
142
+ end
143
+
144
+ add_index "contract_requests", ["original_supplier_id"], :name => "index_contract_requests_on_original_supplier_id"
145
+
146
+ create_table "contract_scans", :force => true do |t|
147
+ t.integer "request_id"
148
+ t.string "image_file_name"
149
+ t.string "image_content_type"
150
+ t.integer "image_file_size"
151
+ t.datetime "image_updated_at"
152
+ t.datetime "created_at", :null => false
153
+ t.datetime "updated_at", :null => false
154
+ t.integer "status", :default => 1, :null => false
155
+ t.text "output"
156
+ t.text "ocr_params"
157
+ end
158
+
159
+ add_index "contract_scans", ["request_id"], :name => "index_contract_scans_on_request_id"
160
+
161
+ create_table "contract_suppliers", :force => true do |t|
162
+ t.string "name"
163
+ t.string "code"
164
+ t.datetime "created_at", :null => false
165
+ t.datetime "updated_at", :null => false
166
+ t.text "ocr_params"
167
+ end
168
+
169
+ create_table "vehicle_manufacturer", :id => false, :force => true do |t|
170
+ t.integer "id"
171
+ t.string "manufacturer", :null => false
172
+ end
173
+
174
+ create_table "vehicle_model", :id => false, :force => true do |t|
175
+ t.string "code", :null => false
176
+ t.string "model", :null => false
177
+ t.integer "internal_id"
178
+ t.integer "manufacturer_id"
179
+ t.boolean "insurance", :default => false, :null => false
180
+ end
181
+
182
+ end