Description:
start migrate to 5.0
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r744:0e4dc1847f88 - - 28 files changed: 518 inserted, 371 deleted

@@ -0,0 +1,3
1 + class ApplicationRecord < ActiveRecord::Base
2 + self.abstract_class = true
3 + end
@@ -0,0 +1,3
1 + #!/usr/bin/env ruby
2 + ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 + load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4
1 + #!/usr/bin/env ruby
2 + APP_PATH = File.expand_path('../config/application', __dir__)
3 + require_relative '../config/boot'
4 + require 'rails/commands'
@@ -0,0 +1,4
1 + #!/usr/bin/env ruby
2 + require_relative '../config/boot'
3 + require 'rake'
4 + Rake.application.run
@@ -0,0 +1,34
1 + #!/usr/bin/env ruby
2 + require 'pathname'
3 + require 'fileutils'
4 + include FileUtils
5 +
6 + # path to your application root.
7 + APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8 +
9 + def system!(*args)
10 + system(*args) || abort("\n== Command #{args} failed ==")
11 + end
12 +
13 + chdir APP_ROOT do
14 + # This script is a starting point to setup your application.
15 + # Add necessary setup steps to this file.
16 +
17 + puts '== Installing dependencies =='
18 + system! 'gem install bundler --conservative'
19 + system('bundle check') || system!('bundle install')
20 +
21 + # puts "\n== Copying sample files =="
22 + # unless File.exist?('config/database.yml')
23 + # cp 'config/database.yml.sample', 'config/database.yml'
24 + # end
25 +
26 + puts "\n== Preparing database =="
27 + system! 'bin/rails db:setup'
28 +
29 + puts "\n== Removing old logs and tempfiles =="
30 + system! 'bin/rails log:clear tmp:clear'
31 +
32 + puts "\n== Restarting application server =="
33 + system! 'bin/rails restart'
34 + end
@@ -0,0 +1,29
1 + #!/usr/bin/env ruby
2 + require 'pathname'
3 + require 'fileutils'
4 + include FileUtils
5 +
6 + # path to your application root.
7 + APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8 +
9 + def system!(*args)
10 + system(*args) || abort("\n== Command #{args} failed ==")
11 + end
12 +
13 + chdir APP_ROOT do
14 + # This script is a way to update your development environment automatically.
15 + # Add necessary update steps to this file.
16 +
17 + puts '== Installing dependencies =='
18 + system! 'gem install bundler --conservative'
19 + system('bundle check') || system!('bundle install')
20 +
21 + puts "\n== Updating database =="
22 + system! 'bin/rails db:migrate'
23 +
24 + puts "\n== Removing old logs and tempfiles =="
25 + system! 'bin/rails log:clear tmp:clear'
26 +
27 + puts "\n== Restarting application server =="
28 + system! 'bin/rails restart'
29 + end
@@ -0,0 +1,9
1 + development:
2 + adapter: async
3 +
4 + test:
5 + adapter: async
6 +
7 + production:
8 + adapter: redis
9 + url: redis://localhost:6379/1
@@ -0,0 +1,8
1 + # Be sure to restart your server when you modify this file.
2 +
3 + # ActiveSupport::Reloader.to_prepare do
4 + # ApplicationController.renderer.defaults.merge!(
5 + # http_host: 'example.org',
6 + # https: false
7 + # )
8 + # end
@@ -0,0 +1,5
1 + # Be sure to restart your server when you modify this file.
2 +
3 + # Specify a serializer for the signed and encrypted cookie jars.
4 + # Valid options are :json, :marshal, and :hybrid.
5 + Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,4
1 + # Be sure to restart your server when you modify this file.
2 +
3 + # Configure sensitive parameters which will be filtered from the log file.
4 + Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,25
1 + # Be sure to restart your server when you modify this file.
2 + #
3 + # This file contains migration options to ease your Rails 5.0 upgrade.
4 + #
5 + # Once upgraded flip defaults one by one to migrate to the new default.
6 + #
7 + # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8 +
9 + Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
10 +
11 + # Enable per-form CSRF tokens. Previous versions had false.
12 + Rails.application.config.action_controller.per_form_csrf_tokens = false
13 +
14 + # Enable origin-checking CSRF mitigation. Previous versions had false.
15 + Rails.application.config.action_controller.forgery_protection_origin_check = false
16 +
17 + # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
18 + # Previous versions had false.
19 + ActiveSupport.to_time_preserves_timezone = false
20 +
21 + # Require `belongs_to` associations by default. Previous versions had false.
22 + Rails.application.config.active_record.belongs_to_required_by_default = false
23 +
24 + # Do not halt callback chains when a callback returns false. Previous versions had true.
25 + ActiveSupport.halt_callback_chains_on_return_false = true
@@ -0,0 +1,47
1 + # Puma can serve each request in a thread from an internal thread pool.
2 + # The `threads` method setting takes two numbers a minimum and maximum.
3 + # Any libraries that use thread pools should be configured to match
4 + # the maximum value specified for Puma. Default is set to 5 threads for minimum
5 + # and maximum, this matches the default thread size of Active Record.
6 + #
7 + threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
8 + threads threads_count, threads_count
9 +
10 + # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
11 + #
12 + port ENV.fetch("PORT") { 3000 }
13 +
14 + # Specifies the `environment` that Puma will run in.
15 + #
16 + environment ENV.fetch("RAILS_ENV") { "development" }
17 +
18 + # Specifies the number of `workers` to boot in clustered mode.
19 + # Workers are forked webserver processes. If using threads and workers together
20 + # the concurrency of the application would be max `threads` * `workers`.
21 + # Workers do not work on JRuby or Windows (both of which do not support
22 + # processes).
23 + #
24 + # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25 +
26 + # Use the `preload_app!` method when specifying a `workers` number.
27 + # This directive tells Puma to first boot the application and load code
28 + # before forking the application. This takes advantage of Copy On Write
29 + # process behavior so workers use less memory. If you use this option
30 + # you need to make sure to reconnect any threads in the `on_worker_boot`
31 + # block.
32 + #
33 + # preload_app!
34 +
35 + # The code in the `on_worker_boot` will be called if you are using
36 + # clustered mode by specifying a number of `workers`. After each worker
37 + # process is booted this block will be run, if you are using `preload_app!`
38 + # option you will want to use this block to reconnect to any threads
39 + # or connections that may have been created at application boot, Ruby
40 + # cannot share connections between processes.
41 + #
42 + # on_worker_boot do
43 + # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
44 + # end
45 +
46 + # Allow puma to be restarted by `rails restart` command.
47 + plugin :tmp_restart
@@ -0,0 +1,6
1 + %w(
2 + .ruby-version
3 + .rbenv-vars
4 + tmp/restart.txt
5 + tmp/caching-dev.txt
6 + ).each { |path| Spring.watch(path) }
@@ -1,7 +1,7
1 1 source 'https://rubygems.org'
2 2
3 3 #rails
4 - gem 'rails', '~>4.2.0'
4 + gem 'rails', '~>5.0'
5 5 gem 'activerecord-session_store'
6 6
7 7
@@ -13,48 +13,51
13 13 ZenTest (~> 4.3)
14 14 ZenTest (4.11.2)
15 15 ace-rails-ap (4.2)
16 - actionmailer (4.2.11.1)
17 - actionpack (= 4.2.11.1)
18 - actionview (= 4.2.11.1)
19 - activejob (= 4.2.11.1)
16 + actioncable (5.0.7.2)
17 + actionpack (= 5.0.7.2)
18 + nio4r (>= 1.2, < 3.0)
19 + websocket-driver (~> 0.6.1)
20 + actionmailer (5.0.7.2)
21 + actionpack (= 5.0.7.2)
22 + actionview (= 5.0.7.2)
23 + activejob (= 5.0.7.2)
20 24 mail (~> 2.5, >= 2.5.4)
21 - rails-dom-testing (~> 1.0, >= 1.0.5)
22 - actionpack (4.2.11.1)
23 - actionview (= 4.2.11.1)
24 - activesupport (= 4.2.11.1)
25 - rack (~> 1.6)
26 - rack-test (~> 0.6.2)
27 - rails-dom-testing (~> 1.0, >= 1.0.5)
25 + rails-dom-testing (~> 2.0)
26 + actionpack (5.0.7.2)
27 + actionview (= 5.0.7.2)
28 + activesupport (= 5.0.7.2)
29 + rack (~> 2.0)
30 + rack-test (~> 0.6.3)
31 + rails-dom-testing (~> 2.0)
28 32 rails-html-sanitizer (~> 1.0, >= 1.0.2)
29 - actionview (4.2.11.1)
30 - activesupport (= 4.2.11.1)
33 + actionview (5.0.7.2)
34 + activesupport (= 5.0.7.2)
31 35 builder (~> 3.1)
32 36 erubis (~> 2.7.0)
33 - rails-dom-testing (~> 1.0, >= 1.0.5)
37 + rails-dom-testing (~> 2.0)
34 38 rails-html-sanitizer (~> 1.0, >= 1.0.3)
35 - activejob (4.2.11.1)
36 - activesupport (= 4.2.11.1)
37 - globalid (>= 0.3.0)
38 - activemodel (4.2.11.1)
39 - activesupport (= 4.2.11.1)
40 - builder (~> 3.1)
41 - activerecord (4.2.11.1)
42 - activemodel (= 4.2.11.1)
43 - activesupport (= 4.2.11.1)
44 - arel (~> 6.0)
39 + activejob (5.0.7.2)
40 + activesupport (= 5.0.7.2)
41 + globalid (>= 0.3.6)
42 + activemodel (5.0.7.2)
43 + activesupport (= 5.0.7.2)
44 + activerecord (5.0.7.2)
45 + activemodel (= 5.0.7.2)
46 + activesupport (= 5.0.7.2)
47 + arel (~> 7.0)
45 48 activerecord-session_store (1.1.3)
46 49 actionpack (>= 4.0)
47 50 activerecord (>= 4.0)
48 51 multi_json (~> 1.11, >= 1.11.2)
49 52 rack (>= 1.5.2, < 3)
50 53 railties (>= 4.0)
51 - activesupport (4.2.11.1)
52 - i18n (~> 0.7)
54 + activesupport (5.0.7.2)
55 + concurrent-ruby (~> 1.0, >= 1.0.2)
56 + i18n (>= 0.7, < 2)
53 57 minitest (~> 5.1)
54 - thread_safe (~> 0.3, >= 0.3.4)
55 58 tzinfo (~> 1.1)
56 59 ansi (1.5.0)
57 - arel (6.0.4)
60 + arel (7.1.4)
58 61 autoprefixer-rails (9.5.1.1)
59 62 execjs
60 63 best_in_place (3.0.3)
@@ -101,7 +104,7
101 104 haml (>= 4.0, < 6)
102 105 nokogiri (>= 1.6.0)
103 106 ruby_parser (~> 3.5)
104 - i18n (0.9.5)
107 + i18n (1.6.0)
105 108 concurrent-ruby (~> 1.0)
106 109 in_place_editing (1.2.0)
107 110 jquery-countdown-rails (2.0.2)
@@ -125,6 +128,7
125 128 nokogiri (>= 1.5.9)
126 129 mail (2.7.1)
127 130 mini_mime (>= 0.1.1)
131 + method_source (0.9.2)
128 132 mini_mime (1.0.1)
129 133 mini_portile2 (2.4.0)
130 134 minitest (5.11.3)
@@ -137,35 +141,35
137 141 railties (>= 3.1)
138 142 multi_json (1.13.1)
139 143 mysql2 (0.5.2)
144 + nio4r (2.3.1)
140 145 nokogiri (1.10.3)
141 146 mini_portile2 (~> 2.4.0)
142 - rack (1.6.11)
147 + rack (2.0.7)
143 148 rack-test (0.6.3)
144 149 rack (>= 1.0)
145 - rails (4.2.11.1)
146 - actionmailer (= 4.2.11.1)
147 - actionpack (= 4.2.11.1)
148 - actionview (= 4.2.11.1)
149 - activejob (= 4.2.11.1)
150 - activemodel (= 4.2.11.1)
151 - activerecord (= 4.2.11.1)
152 - activesupport (= 4.2.11.1)
153 - bundler (>= 1.3.0, < 2.0)
154 - railties (= 4.2.11.1)
155 - sprockets-rails
156 - rails-deprecated_sanitizer (1.0.3)
157 - activesupport (>= 4.2.0.alpha)
158 - rails-dom-testing (1.0.9)
159 - activesupport (>= 4.2.0, < 5.0)
160 - nokogiri (~> 1.6)
161 - rails-deprecated_sanitizer (>= 1.0.1)
150 + rails (5.0.7.2)
151 + actioncable (= 5.0.7.2)
152 + actionmailer (= 5.0.7.2)
153 + actionpack (= 5.0.7.2)
154 + actionview (= 5.0.7.2)
155 + activejob (= 5.0.7.2)
156 + activemodel (= 5.0.7.2)
157 + activerecord (= 5.0.7.2)
158 + activesupport (= 5.0.7.2)
159 + bundler (>= 1.3.0)
160 + railties (= 5.0.7.2)
161 + sprockets-rails (>= 2.0.0)
162 + rails-dom-testing (2.0.3)
163 + activesupport (>= 4.2.0)
164 + nokogiri (>= 1.6)
162 165 rails-html-sanitizer (1.0.4)
163 166 loofah (~> 2.2, >= 2.2.2)
164 167 rails_bootstrap_sortable (2.0.6)
165 168 momentjs-rails (>= 2.8.3)
166 - railties (4.2.11.1)
167 - actionpack (= 4.2.11.1)
168 - activesupport (= 4.2.11.1)
169 + railties (5.0.7.2)
170 + actionpack (= 5.0.7.2)
171 + activesupport (= 5.0.7.2)
172 + method_source
169 173 rake (>= 0.8.7)
170 174 thor (>= 0.18.1, < 2.0)
171 175 rake (12.3.2)
@@ -216,6 +220,9
216 220 thread_safe (~> 0.1)
217 221 uglifier (4.1.20)
218 222 execjs (>= 0.3.0, < 3)
223 + websocket-driver (0.6.5)
224 + websocket-extensions (>= 0.1.0)
225 + websocket-extensions (0.1.4)
219 226 will_paginate (3.0.12)
220 227 yaml_db (0.7.0)
221 228 rails (>= 3.0)
@@ -250,7 +257,7
250 257 minitest-reporters
251 258 momentjs-rails
252 259 mysql2
253 - rails (~> 4.2.0)
260 + rails (~> 5.0)
254 261 rails_bootstrap_sortable
255 262 rdiscount
256 263 rouge
@@ -1,6 +1,3
1 - require 'rubygems'
1 + ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2 2
3 - # Set up gems listed in the Gemfile.
4 - ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5 -
6 - require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
3 + require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,5 +1,5
1 - # Load the rails application
2 - require File.expand_path('../application', __FILE__)
1 + # Load the Rails application.
2 + require_relative 'application'
3 3
4 - # Initialize the rails application
5 - CafeGrader::Application.initialize!
4 + # Initialize the Rails application.
5 + Rails.application.initialize!
@@ -1,42 +1,54
1 - CafeGrader::Application.configure do
2 - # Settings specified here will take precedence over those in config/application.rb
1 + Rails.application.configure do
2 + # Settings specified here will take precedence over those in config/application.rb.
3 3
4 4 # In the development environment your application's code is reloaded on
5 5 # every request. This slows down response time but is perfect for development
6 6 # since you don't have to restart the web server when you make code changes.
7 7 config.cache_classes = false
8 8
9 - # Log error messages when you accidentally call methods on nil. //DEPRICATED
10 - # config.whiny_nils = true // DEPRICATED
9 + # Do not eager load code on boot.
10 + config.eager_load = false
11 +
12 + # Show full error reports.
13 + config.consider_all_requests_local = true
14 +
15 + # Enable/disable caching. By default caching is disabled.
16 + if Rails.root.join('tmp/caching-dev.txt').exist?
17 + config.action_controller.perform_caching = true
11 18
12 - # Show full error reports and disable caching
13 - config.consider_all_requests_local = true
14 - config.action_controller.perform_caching = false
19 + config.cache_store = :memory_store
20 + config.public_file_server.headers = {
21 + 'Cache-Control' => 'public, max-age=172800'
22 + }
23 + else
24 + config.action_controller.perform_caching = false
15 25
16 - # Don't care if the mailer can't send
26 + config.cache_store = :null_store
27 + end
28 +
29 + # Don't care if the mailer can't send.
17 30 config.action_mailer.raise_delivery_errors = false
18 31
19 - # Print deprecation notices to the Rails logger
32 + config.action_mailer.perform_caching = false
33 +
34 + # Print deprecation notices to the Rails logger.
20 35 config.active_support.deprecation = :log
21 36
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 //DEPRICATED
37 + # Raise an error on page load if there are pending migrations.
38 + config.active_record.migration_error = :page_load
27 39
28 - # Log the query plan for queries taking more than this (works // DEPRICATED
29 - # with SQLite, MySQL, and PostgreSQL) // DEPRICATED
30 - # config.active_record.auto_explain_threshold_in_seconds = 0.5 // DEPRICATED
31 -
32 - # Do not compress assets
33 - config.assets.compress = false
34 -
35 - # Expands the lines which load the assets
40 + # Debug mode disables concatenation and preprocessing of assets.
41 + # This option may cause significant delays in view rendering with a large
42 + # number of complex assets.
36 43 config.assets.debug = true
37 44
38 - # Prevents assets from rendering twice
39 - config.serve_static_files = true
45 + # Suppress logger output for asset requests.
46 + config.assets.quiet = true
40 47
41 - config.eager_load = false
48 + # Raises error for missing translations
49 + # config.action_view.raise_on_missing_translations = true
50 +
51 + # Use an evented file watcher to asynchronously detect changes in source code,
52 + # routes, locales, etc. This feature depends on the listen gem.
53 + # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
42 54 end
@@ -1,69 +1,86
1 - CafeGrader::Application.configure do
2 - # Settings specified here will take precedence over those in config/application.rb
1 + Rails.application.configure do
2 + # Settings specified here will take precedence over those in config/application.rb.
3 3
4 - # Code is not reloaded between requests
4 + # Code is not reloaded between requests.
5 5 config.cache_classes = true
6 6
7 - # Full error reports are disabled and caching is turned on
7 + # Eager load code on boot. This eager loads most of Rails and
8 + # your application in memory, allowing both threaded web servers
9 + # and those relying on copy on write to perform better.
10 + # Rake tasks automatically ignore this option for performance.
11 + config.eager_load = true
12 +
13 + # Full error reports are disabled and caching is turned on.
8 14 config.consider_all_requests_local = false
9 15 config.action_controller.perform_caching = true
10 16
11 - # Disable Rails's static asset server (Apache or nginx will already do this)
12 - config.serve_static_files = false
17 + # Disable serving static files from the `/public` folder by default since
18 + # Apache or NGINX already handles this.
19 + config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
13 20
14 - # Compress JavaScripts and CSS
15 - config.assets.compress = true
21 + # Compress JavaScripts and CSS.
22 + config.assets.js_compressor = :uglifier
23 + # config.assets.css_compressor = :sass
16 24
17 - # Don't fallback to assets pipeline if a precompiled asset is missed
25 + # Do not fallback to assets pipeline if a precompiled asset is missed.
18 26 config.assets.compile = false
19 27
20 - # Generate digests for assets URLs
21 - config.assets.digest = true
28 + # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
29 +
30 + # Enable serving of images, stylesheets, and JavaScripts from an asset server.
31 + # config.action_controller.asset_host = 'http://assets.example.com'
22 32
23 - # Defaults to nil and saved in location specified by config.assets.prefix
24 - # config.assets.manifest = YOUR_PATH
33 + # Specifies the header that your server uses for sending files.
34 + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
35 + # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
25 36
26 - # Specifies the header that your server uses for sending files
27 - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28 - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
37 + # Mount Action Cable outside main process or domain
38 + # config.action_cable.mount_path = nil
39 + # config.action_cable.url = 'wss://example.com/cable'
40 + # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
29 41
30 42 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31 43 # config.force_ssl = true
32 44
33 - # See everything in the log (default is :info)
34 - # config.log_level = :debug
45 + # Use the lowest log level to ensure availability of diagnostic information
46 + # when problems arise.
47 + config.log_level = :debug
35 48
36 - # Prepend all log lines with the following tags
37 - # config.log_tags = [ :subdomain, :uuid ]
49 + # Prepend all log lines with the following tags.
50 + config.log_tags = [ :request_id ]
38 51
39 - # Use a different logger for distributed setups
40 - # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41 -
42 - # Use a different cache store in production
52 + # Use a different cache store in production.
43 53 # config.cache_store = :mem_cache_store
44 54
45 - # Enable serving of images, stylesheets, and JavaScripts from an asset server
46 - # config.action_controller.asset_host = "http://assets.example.com"
47 -
48 - # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49 - # config.assets.precompile += %w( search.js )
55 + # Use a real queuing backend for Active Job (and separate queues per environment)
56 + # config.active_job.queue_adapter = :resque
57 + # config.active_job.queue_name_prefix = "cafe_grader_#{Rails.env}"
58 + config.action_mailer.perform_caching = false
50 59
51 - # Disable delivery errors, bad email addresses will be ignored
60 + # Ignore bad email addresses and do not raise email delivery errors.
61 + # Set this to true and configure the email server for immediate delivery to raise delivery errors.
52 62 # config.action_mailer.raise_delivery_errors = false
53 63
54 - # Enable threaded mode
55 - # config.threadsafe!
56 -
57 64 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58 - # the I18n.default_locale when a translation can not be found)
65 + # the I18n.default_locale when a translation cannot be found).
59 66 config.i18n.fallbacks = true
60 67
61 - # Send deprecation notices to registered listeners
68 + # Send deprecation notices to registered listeners.
62 69 config.active_support.deprecation = :notify
63 70
64 - # Log the query plan for queries taking more than this (works
65 - # with SQLite, MySQL, and PostgreSQL)
66 - # config.active_record.auto_explain_threshold_in_seconds = 0.5
71 + # Use default logging formatter so that PID and timestamp are not suppressed.
72 + config.log_formatter = ::Logger::Formatter.new
73 +
74 + # Use a different logger for distributed setups.
75 + # require 'syslog/logger'
76 + # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
67 77
68 - config.eager_load = true
78 + if ENV["RAILS_LOG_TO_STDOUT"].present?
79 + logger = ActiveSupport::Logger.new(STDOUT)
80 + logger.formatter = config.log_formatter
81 + config.logger = ActiveSupport::TaggedLogging.new(logger)
82 + end
83 +
84 + # Do not dump schema after migrations.
85 + config.active_record.dump_schema_after_migration = false
69 86 end
@@ -1,5 +1,5
1 - CafeGrader::Application.configure do
2 - # Settings specified here will take precedence over those in config/application.rb
1 + Rails.application.configure do
2 + # Settings specified here will take precedence over those in config/application.rb.
3 3
4 4 # The test environment is used exclusively to run your application's
5 5 # test suite. You never need to work with it otherwise. Remember that
@@ -7,37 +7,36
7 7 # and recreated between test runs. Don't rely on the data there!
8 8 config.cache_classes = true
9 9
10 - # Configure static asset server for tests with Cache-Control for performance
11 - config.serve_static_files = true
12 - config.static_cache_control = "public, max-age=3600"
10 + # Do not eager load code on boot. This avoids loading your whole application
11 + # just for the purpose of running a single test. If you are using a tool that
12 + # preloads Rails for running tests, you may have to set it to true.
13 + config.eager_load = false
13 14
14 - # Log error messages when you accidentally call methods on nil
15 - config.whiny_nils = true
15 + # Configure public file server for tests with Cache-Control for performance.
16 + config.public_file_server.enabled = true
17 + config.public_file_server.headers = {
18 + 'Cache-Control' => 'public, max-age=3600'
19 + }
16 20
17 - # Show full error reports and disable caching
21 + # Show full error reports and disable caching.
18 22 config.consider_all_requests_local = true
19 23 config.action_controller.perform_caching = false
20 24
21 - # Raise exceptions instead of rendering exception templates
25 + # Raise exceptions instead of rendering exception templates.
22 26 config.action_dispatch.show_exceptions = false
23 27
24 - # Disable request forgery protection in test environment
25 - config.action_controller.allow_forgery_protection = false
28 + # Disable request forgery protection in test environment.
29 + config.action_controller.allow_forgery_protection = false
30 + config.action_mailer.perform_caching = false
26 31
27 32 # Tell Action Mailer not to deliver emails to the real world.
28 33 # The :test delivery method accumulates sent emails in the
29 34 # ActionMailer::Base.deliveries array.
30 35 config.action_mailer.delivery_method = :test
31 36
32 - # Raise exception on mass assignment protection for Active Record models
33 - #config.active_record.mass_assignment_sanitizer = :strict // DEPRICATED
34 -
35 - # Print deprecation notices to the stderr
37 + # Print deprecation notices to the stderr.
36 38 config.active_support.deprecation = :stderr
37 39
38 - config.eager_load = false
39 -
40 - #test order
41 - config.active_support.test_order = :sorted
42 -
40 + # Raises error for missing translations
41 + # config.action_view.raise_on_missing_translations = true
43 42 end
@@ -3,20 +3,15
3 3 # Version of your assets, change this if you want to expire all your assets.
4 4 Rails.application.config.assets.version = '1.0'
5 5
6 - # Add additional assets to the asset load path.
6 + # Add additional assets to the asset load path
7 7 # Rails.application.config.assets.paths << Emoji.images_path
8 - # Add Yarn node_modules folder to the asset load path.
9 - Rails.application.config.assets.paths << Rails.root.join('node_modules')
10 - Rails.application.config.assets.paths << Rails.root.join('vendor/assets/fonts')
11 8
12 9 # Precompile additional assets.
13 - # application.js, application.css, and all non-JS/CSS in the app/assets
14 - # folder are already added.
15 - # Rails.application.config.assets.precompile += %w( admin.js admin.css )
16 -
10 + # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11 + # Rails.application.config.assets.precompile += %w( search.js )
17 12 Rails.application.config.assets.precompile += ['announcement_refresh.js','effects.js','site_update.js']
18 13 Rails.application.config.assets.precompile += ['local_jquery.js','tablesorter-theme.cafe.css']
19 - %w( announcements submissions configurations contests contest_management graders heartbeat
14 + %w( announcements submissions configurations contests contest_management graders heartbeat
20 15 login main messages problems report site sites sources tasks groups
21 16 test user_admin users tags testcases).each do |controller|
22 17 Rails.application.config.assets.precompile += ["#{controller}.js", "#{controller}.css"]
@@ -1,15 +1,16
1 1 # Be sure to restart your server when you modify this file.
2 2
3 - # Add new inflection rules using the following format
4 - # (all these examples are active by default):
5 - # ActiveSupport::Inflector.inflections do |inflect|
3 + # Add new inflection rules using the following format. Inflections
4 + # are locale specific, and you may define rules for as many different
5 + # locales as you wish. All of these examples are active by default:
6 + # ActiveSupport::Inflector.inflections(:en) do |inflect|
6 7 # inflect.plural /^(ox)$/i, '\1en'
7 8 # inflect.singular /^(ox)en/i, '\1'
8 9 # inflect.irregular 'person', 'people'
9 10 # inflect.uncountable %w( fish sheep )
10 11 # end
11 - #
12 +
12 13 # These inflection rules are supported but not enabled by default:
13 - # ActiveSupport::Inflector.inflections do |inflect|
14 + # ActiveSupport::Inflector.inflections(:en) do |inflect|
14 15 # inflect.acronym 'RESTful'
15 16 # end
@@ -2,4 +2,3
2 2
3 3 # Add new mime types for use in respond_to blocks:
4 4 # Mime::Type.register "text/richtext", :rtf
5 - # Mime::Type.register_alias "text/html", :iphone
@@ -1,8 +1,3
1 1 # Be sure to restart your server when you modify this file.
2 - #CafeGrader::Application.config.session_store :cookie_store, key: '_cafe_grader_web_session'
3 2
4 - # Use the database for sessions instead of the cookie-based default,
5 - # which shouldn't be used to store highly confidential information
6 - # (create the session table with "rails generate session_migration")
7 -
8 - CafeGrader::Application.config.session_store :active_record_store
3 + Rails.application.config.session_store :cookie_store, key: '_cafe_grader_session'
@@ -1,5 +1,5
1 1 # Be sure to restart your server when you modify this file.
2 - #
2 +
3 3 # This file contains settings for ActionController::ParamsWrapper which
4 4 # is enabled by default.
5 5
@@ -8,7 +8,7
8 8 wrap_parameters format: [:json]
9 9 end
10 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
11 + # To enable root element in JSON for ActiveRecord objects.
12 + # ActiveSupport.on_load(:active_record) do
13 + # self.include_root_in_json = true
14 + # end
@@ -110,5 +110,5
110 110
111 111 # This is a legacy wild controller route that's not recommended for RESTful applications.
112 112 # Note: This route will make all actions in every controller accessible via GET requests.
113 - match ':controller(/:action(/:id))(.:format)', via: [:get, :post]
113 + # match ':controller(/:action(/:id))(.:format)', via: [:get, :post]
114 114 end
@@ -1,4 +1,3
1 - # encoding: UTF-8
2 1 # This file is auto-generated from the current state of the database. Instead
3 2 # of editing this file, please use the migrations feature of Active Record to
4 3 # incrementally modify your database, and then regenerate this schema definition.
@@ -13,309 +12,296
13 12
14 13 ActiveRecord::Schema.define(version: 20180612102327) do
15 14
16 - create_table "announcements", force: :cascade do |t|
17 - t.string "author", limit: 255
15 + create_table "announcements", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
16 + t.string "author"
18 17 t.text "body", limit: 65535
19 18 t.boolean "published"
20 19 t.datetime "created_at"
21 20 t.datetime "updated_at"
22 21 t.boolean "frontpage", default: false
23 22 t.boolean "contest_only", default: false
24 - t.string "title", limit: 255
25 - t.string "notes", limit: 255
23 + t.string "title"
24 + t.string "notes"
26 25 end
27 26
28 - create_table "contests", force: :cascade do |t|
29 - t.string "title", limit: 255
27 + create_table "contests", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
28 + t.string "title"
30 29 t.boolean "enabled"
31 30 t.datetime "created_at"
32 31 t.datetime "updated_at"
33 - t.string "name", limit: 255
32 + t.string "name"
34 33 end
35 34
36 - create_table "contests_problems", id: false, force: :cascade do |t|
37 - t.integer "contest_id", limit: 4
38 - t.integer "problem_id", limit: 4
35 + create_table "contests_problems", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
36 + t.integer "contest_id"
37 + t.integer "problem_id"
39 38 end
40 39
41 - create_table "contests_users", id: false, force: :cascade do |t|
42 - t.integer "contest_id", limit: 4
43 - t.integer "user_id", limit: 4
40 + create_table "contests_users", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
41 + t.integer "contest_id"
42 + t.integer "user_id"
44 43 end
45 44
46 - create_table "countries", force: :cascade do |t|
47 - t.string "name", limit: 255
45 + create_table "countries", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
46 + t.string "name"
48 47 t.datetime "created_at"
49 48 t.datetime "updated_at"
50 49 end
51 50
52 - create_table "descriptions", force: :cascade do |t|
51 + create_table "descriptions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
53 52 t.text "body", limit: 65535
54 53 t.boolean "markdowned"
55 54 t.datetime "created_at"
56 55 t.datetime "updated_at"
57 56 end
58 57
59 - create_table "grader_configurations", force: :cascade do |t|
60 - t.string "key", limit: 255
61 - t.string "value_type", limit: 255
62 - t.string "value", limit: 255
58 + create_table "grader_configurations", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
59 + t.string "key"
60 + t.string "value_type"
61 + t.string "value"
63 62 t.datetime "created_at"
64 63 t.datetime "updated_at"
65 64 t.text "description", limit: 65535
66 65 end
67 66
68 - create_table "grader_processes", force: :cascade do |t|
69 - t.string "host", limit: 255
70 - t.integer "pid", limit: 4
71 - t.string "mode", limit: 255
67 + create_table "grader_processes", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
68 + t.string "host"
69 + t.integer "pid"
70 + t.string "mode"
72 71 t.boolean "active"
73 72 t.datetime "created_at"
74 73 t.datetime "updated_at"
75 - t.integer "task_id", limit: 4
76 - t.string "task_type", limit: 255
74 + t.integer "task_id"
75 + t.string "task_type"
77 76 t.boolean "terminated"
77 + t.index ["host", "pid"], name: "index_grader_processes_on_host_and_pid", using: :btree
78 78 end
79 79
80 - add_index "grader_processes", ["host", "pid"], name: "index_grader_processes_on_host_and_pid", using: :btree
81 -
82 - create_table "groups", force: :cascade do |t|
83 - t.string "name", limit: 255
84 - t.string "description", limit: 255
80 + create_table "groups", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
81 + t.string "name"
82 + t.string "description"
85 83 end
86 84
87 - create_table "groups_problems", id: false, force: :cascade do |t|
88 - t.integer "problem_id", limit: 4, null: false
89 - t.integer "group_id", limit: 4, null: false
85 + create_table "groups_problems", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
86 + t.integer "problem_id", null: false
87 + t.integer "group_id", null: false
88 + t.index ["group_id", "problem_id"], name: "index_groups_problems_on_group_id_and_problem_id", using: :btree
90 89 end
91 90
92 - add_index "groups_problems", ["group_id", "problem_id"], name: "index_groups_problems_on_group_id_and_problem_id", using: :btree
93 -
94 - create_table "groups_users", id: false, force: :cascade do |t|
95 - t.integer "group_id", limit: 4, null: false
96 - t.integer "user_id", limit: 4, null: false
91 + create_table "groups_users", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
92 + t.integer "group_id", null: false
93 + t.integer "user_id", null: false
94 + t.index ["user_id", "group_id"], name: "index_groups_users_on_user_id_and_group_id", using: :btree
97 95 end
98 96
99 - add_index "groups_users", ["user_id", "group_id"], name: "index_groups_users_on_user_id_and_group_id", using: :btree
100 -
101 - create_table "heart_beats", force: :cascade do |t|
102 - t.integer "user_id", limit: 4
103 - t.string "ip_address", limit: 255
97 + create_table "heart_beats", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
98 + t.integer "user_id"
99 + t.string "ip_address"
104 100 t.datetime "created_at"
105 101 t.datetime "updated_at"
106 - t.string "status", limit: 255
102 + t.string "status"
103 + t.index ["updated_at"], name: "index_heart_beats_on_updated_at", using: :btree
107 104 end
108 105
109 - add_index "heart_beats", ["updated_at"], name: "index_heart_beats_on_updated_at", using: :btree
110 -
111 - create_table "languages", force: :cascade do |t|
106 + create_table "languages", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
112 107 t.string "name", limit: 10
113 - t.string "pretty_name", limit: 255
108 + t.string "pretty_name"
114 109 t.string "ext", limit: 10
115 - t.string "common_ext", limit: 255
110 + t.string "common_ext"
116 111 end
117 112
118 - create_table "logins", force: :cascade do |t|
119 - t.integer "user_id", limit: 4
120 - t.string "ip_address", limit: 255
113 + create_table "logins", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
114 + t.integer "user_id"
115 + t.string "ip_address"
121 116 t.datetime "created_at"
122 117 t.datetime "updated_at"
123 118 end
124 119
125 - create_table "messages", force: :cascade do |t|
126 - t.integer "sender_id", limit: 4
127 - t.integer "receiver_id", limit: 4
128 - t.integer "replying_message_id", limit: 4
120 + create_table "messages", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
121 + t.integer "sender_id"
122 + t.integer "receiver_id"
123 + t.integer "replying_message_id"
129 124 t.text "body", limit: 65535
130 125 t.boolean "replied"
131 126 t.datetime "created_at"
132 127 t.datetime "updated_at"
133 128 end
134 129
135 - create_table "problems", force: :cascade do |t|
130 + create_table "problems", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
136 131 t.string "name", limit: 30
137 - t.string "full_name", limit: 255
138 - t.integer "full_score", limit: 4
132 + t.string "full_name"
133 + t.integer "full_score"
139 134 t.date "date_added"
140 135 t.boolean "available"
141 - t.string "url", limit: 255
142 - t.integer "description_id", limit: 4
136 + t.string "url"
137 + t.integer "description_id"
143 138 t.boolean "test_allowed"
144 139 t.boolean "output_only"
145 - t.string "description_filename", limit: 255
140 + t.string "description_filename"
146 141 t.boolean "view_testcase"
147 142 end
148 143
149 - create_table "problems_tags", force: :cascade do |t|
150 - t.integer "problem_id", limit: 4
151 - t.integer "tag_id", limit: 4
144 + create_table "problems_tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
145 + t.integer "problem_id"
146 + t.integer "tag_id"
147 + t.index ["problem_id", "tag_id"], name: "index_problems_tags_on_problem_id_and_tag_id", unique: true, using: :btree
148 + t.index ["problem_id"], name: "index_problems_tags_on_problem_id", using: :btree
149 + t.index ["tag_id"], name: "index_problems_tags_on_tag_id", using: :btree
152 150 end
153 151
154 - add_index "problems_tags", ["problem_id", "tag_id"], name: "index_problems_tags_on_problem_id_and_tag_id", unique: true, using: :btree
155 - add_index "problems_tags", ["problem_id"], name: "index_problems_tags_on_problem_id", using: :btree
156 - add_index "problems_tags", ["tag_id"], name: "index_problems_tags_on_tag_id", using: :btree
157 -
158 - create_table "rights", force: :cascade do |t|
159 - t.string "name", limit: 255
160 - t.string "controller", limit: 255
161 - t.string "action", limit: 255
152 + create_table "rights", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
153 + t.string "name"
154 + t.string "controller"
155 + t.string "action"
162 156 end
163 157
164 - create_table "rights_roles", id: false, force: :cascade do |t|
165 - t.integer "right_id", limit: 4
166 - t.integer "role_id", limit: 4
158 + create_table "rights_roles", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
159 + t.integer "right_id"
160 + t.integer "role_id"
161 + t.index ["role_id"], name: "index_rights_roles_on_role_id", using: :btree
167 162 end
168 163
169 - add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id", using: :btree
170 -
171 - create_table "roles", force: :cascade do |t|
172 - t.string "name", limit: 255
164 + create_table "roles", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
165 + t.string "name"
173 166 end
174 167
175 - create_table "roles_users", id: false, force: :cascade do |t|
176 - t.integer "role_id", limit: 4
177 - t.integer "user_id", limit: 4
168 + create_table "roles_users", id: false, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
169 + t.integer "role_id"
170 + t.integer "user_id"
171 + t.index ["user_id"], name: "index_roles_users_on_user_id", using: :btree
178 172 end
179 173
180 - add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree
181 -
182 - create_table "sessions", force: :cascade do |t|
183 - t.string "session_id", limit: 255
174 + create_table "sessions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
175 + t.string "session_id"
184 176 t.text "data", limit: 65535
185 177 t.datetime "updated_at"
178 + t.index ["session_id"], name: "index_sessions_on_session_id", using: :btree
179 + t.index ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
186 180 end
187 181
188 - add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
189 - add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
190 -
191 - create_table "sites", force: :cascade do |t|
192 - t.string "name", limit: 255
182 + create_table "sites", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
183 + t.string "name"
193 184 t.boolean "started"
194 185 t.datetime "start_time"
195 186 t.datetime "created_at"
196 187 t.datetime "updated_at"
197 - t.integer "country_id", limit: 4
198 - t.string "password", limit: 255
188 + t.integer "country_id"
189 + t.string "password"
199 190 end
200 191
201 - create_table "submission_view_logs", force: :cascade do |t|
202 - t.integer "user_id", limit: 4
203 - t.integer "submission_id", limit: 4
192 + create_table "submission_view_logs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
193 + t.integer "user_id"
194 + t.integer "submission_id"
204 195 t.datetime "created_at"
205 196 t.datetime "updated_at"
206 197 end
207 198
208 - create_table "submissions", force: :cascade do |t|
209 - t.integer "user_id", limit: 4
210 - t.integer "problem_id", limit: 4
211 - t.integer "language_id", limit: 4
199 + create_table "submissions", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
200 + t.integer "user_id"
201 + t.integer "problem_id"
202 + t.integer "language_id"
212 203 t.text "source", limit: 16777215
213 204 t.binary "binary", limit: 65535
214 205 t.datetime "submitted_at"
215 206 t.datetime "compiled_at"
216 207 t.text "compiler_message", limit: 65535
217 208 t.datetime "graded_at"
218 - t.integer "points", limit: 4
209 + t.integer "points"
219 210 t.text "grader_comment", limit: 65535
220 - t.integer "number", limit: 4
221 - t.string "source_filename", limit: 255
211 + t.integer "number"
212 + t.string "source_filename"
222 213 t.float "max_runtime", limit: 24
223 - t.integer "peak_memory", limit: 4
224 - t.integer "effective_code_length", limit: 4
225 - t.string "ip_address", limit: 255
214 + t.integer "peak_memory"
215 + t.integer "effective_code_length"
216 + t.string "ip_address"
217 + t.index ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree
218 + t.index ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree
226 219 end
227 220
228 - add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree
229 - add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree
230 -
231 - create_table "tags", force: :cascade do |t|
232 - t.string "name", limit: 255, null: false
221 + create_table "tags", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
222 + t.string "name", null: false
233 223 t.text "description", limit: 65535
234 224 t.boolean "public"
235 225 t.datetime "created_at", null: false
236 226 t.datetime "updated_at", null: false
237 227 end
238 228
239 - create_table "tasks", force: :cascade do |t|
240 - t.integer "submission_id", limit: 4
229 + create_table "tasks", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
230 + t.integer "submission_id"
241 231 t.datetime "created_at"
242 - t.integer "status", limit: 4
232 + t.integer "status"
243 233 t.datetime "updated_at"
234 + t.index ["submission_id"], name: "index_tasks_on_submission_id", using: :btree
244 235 end
245 236
246 - add_index "tasks", ["submission_id"], name: "index_tasks_on_submission_id", using: :btree
247 -
248 - create_table "test_pairs", force: :cascade do |t|
249 - t.integer "problem_id", limit: 4
237 + create_table "test_pairs", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
238 + t.integer "problem_id"
250 239 t.text "input", limit: 16777215
251 240 t.text "solution", limit: 16777215
252 241 t.datetime "created_at"
253 242 t.datetime "updated_at"
254 243 end
255 244
256 - create_table "test_requests", force: :cascade do |t|
257 - t.integer "user_id", limit: 4
258 - t.integer "problem_id", limit: 4
259 - t.integer "submission_id", limit: 4
260 - t.string "input_file_name", limit: 255
261 - t.string "output_file_name", limit: 255
262 - t.string "running_stat", limit: 255
263 - t.integer "status", limit: 4
245 + create_table "test_requests", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
246 + t.integer "user_id"
247 + t.integer "problem_id"
248 + t.integer "submission_id"
249 + t.string "input_file_name"
250 + t.string "output_file_name"
251 + t.string "running_stat"
252 + t.integer "status"
264 253 t.datetime "updated_at"
265 254 t.datetime "submitted_at"
266 255 t.datetime "compiled_at"
267 256 t.text "compiler_message", limit: 65535
268 257 t.datetime "graded_at"
269 - t.string "grader_comment", limit: 255
258 + t.string "grader_comment"
270 259 t.datetime "created_at"
271 260 t.float "running_time", limit: 24
272 - t.string "exit_status", limit: 255
273 - t.integer "memory_usage", limit: 4
261 + t.string "exit_status"
262 + t.integer "memory_usage"
263 + t.index ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id", using: :btree
274 264 end
275 265
276 - add_index "test_requests", ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id", using: :btree
277 -
278 - create_table "testcases", force: :cascade do |t|
279 - t.integer "problem_id", limit: 4
280 - t.integer "num", limit: 4
281 - t.integer "group", limit: 4
282 - t.integer "score", limit: 4
266 + create_table "testcases", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
267 + t.integer "problem_id"
268 + t.integer "num"
269 + t.integer "group"
270 + t.integer "score"
283 271 t.text "input", limit: 4294967295
284 272 t.text "sol", limit: 4294967295
285 273 t.datetime "created_at"
286 274 t.datetime "updated_at"
275 + t.index ["problem_id"], name: "index_testcases_on_problem_id", using: :btree
287 276 end
288 277
289 - add_index "testcases", ["problem_id"], name: "index_testcases_on_problem_id", using: :btree
290 -
291 - create_table "user_contest_stats", force: :cascade do |t|
292 - t.integer "user_id", limit: 4
278 + create_table "user_contest_stats", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
279 + t.integer "user_id"
293 280 t.datetime "started_at"
294 281 t.datetime "created_at"
295 282 t.datetime "updated_at"
296 283 t.boolean "forced_logout"
297 284 end
298 285
299 - create_table "users", force: :cascade do |t|
286 + create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t|
300 287 t.string "login", limit: 50
301 - t.string "full_name", limit: 255
302 - t.string "hashed_password", limit: 255
288 + t.string "full_name"
289 + t.string "hashed_password"
303 290 t.string "salt", limit: 5
304 - t.string "alias", limit: 255
305 - t.string "email", limit: 255
306 - t.integer "site_id", limit: 4
307 - t.integer "country_id", limit: 4
308 - t.boolean "activated", default: false
291 + t.string "alias"
292 + t.string "email"
293 + t.integer "site_id"
294 + t.integer "country_id"
295 + t.boolean "activated", default: false
309 296 t.datetime "created_at"
310 297 t.datetime "updated_at"
311 - t.string "section", limit: 255
312 - t.boolean "enabled", default: true
313 - t.string "remark", limit: 255
314 - t.string "last_ip", limit: 255
298 + t.string "section"
299 + t.boolean "enabled", default: true
300 + t.string "remark"
301 + t.string "last_ip"
302 + t.index ["login"], name: "index_users_on_login", unique: true, using: :btree
315 303 end
316 304
317 - add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree
318 -
319 305 add_foreign_key "problems_tags", "problems"
320 306 add_foreign_key "problems_tags", "tags"
321 307 end
deleted file
You need to be logged in to leave comments. Login now