diff --git a/.env.sample b/.env.sample index 3417481c..26e7fae3 100644 --- a/.env.sample +++ b/.env.sample @@ -4,6 +4,4 @@ # https://devcenter.heroku.com/articles/heroku-local#set-up-your-local-environment-variables PORT=3000 - -# PUMA_WORKERS=1 -PUMA_THREADS=5 +RAILS_MAX_THREADS=5 diff --git a/.gitignore b/.gitignore index ec5ed138..cfef5be3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. +# See https://help.github.com/articles/ignoring-files for more about ignoring files. # # If you find yourself ignoring temporary files generated by your text editor # or operating system, you probably want to add a global ignore instead: # git config --global core.excludesfile '~/.gitignore_global' -# Ignore local config. +# Ignore bundler config. /.bundle + +# Ingore application config. /.env # Ignore the default SQLite database. @@ -13,11 +15,23 @@ /db/*.sqlite3-journal # Ignore all logfiles and tempfiles. -/log/*.log -/tmp -/spec/examples.txt +/log/* +/tmp/* +!/log/.keep +!/tmp/.keep /.rubocop-* -# Ignore compiled assets. -/public/assets +# Ingore testing and debugging. +/spec/examples.txt +.byebug_history + +# Ignore uploaded files in development. +/storage/* +!/storage/.keep + +# Ignore compiled assets and node modules. /node_modules +/public/assets + +# Ignore master key for decrypting credentials and more. +/config/master.key diff --git a/Gemfile b/Gemfile index fd19b4a1..fbbfaf8b 100644 --- a/Gemfile +++ b/Gemfile @@ -9,13 +9,12 @@ gem "bootsnap", require: false gem "pg" gem "puma" gem "rack-canonical-host" -gem "rails", "~> 5.2.3" +gem "rails", "~> 6.0.0.rc1" # Front-endy gem "autoprefixer-rails" gem "bootstrap", "~> 4.3.1" gem "jquery-rails" -gem "sass-rails", require: false # Only needed for generator (e.g. rail g controller Users) gem "sassc-rails" gem "simple_form" gem "slim-rails" @@ -32,7 +31,7 @@ end group :development, :test do gem "factory_bot_rails" - gem "rspec-rails" + gem "rspec-rails", "~> 4.0.0.beta2" # For Rails 6 support. gem "rspec_junit_formatter" gem "rubocop", require: false gem "rubocop-performance", require: false diff --git a/Gemfile.lock b/Gemfile.lock index fa36d958..7ef0865b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,55 +1,68 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.3) - actionpack (= 5.2.3) + actioncable (6.0.0.rc1) + actionpack (= 6.0.0.rc1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.3) - actionpack (= 5.2.3) - actionview (= 5.2.3) - activejob (= 5.2.3) + actionmailbox (6.0.0.rc1) + actionpack (= 6.0.0.rc1) + activejob (= 6.0.0.rc1) + activerecord (= 6.0.0.rc1) + activestorage (= 6.0.0.rc1) + activesupport (= 6.0.0.rc1) + mail (>= 2.7.1) + actionmailer (6.0.0.rc1) + actionpack (= 6.0.0.rc1) + actionview (= 6.0.0.rc1) + activejob (= 6.0.0.rc1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.3) - actionview (= 5.2.3) - activesupport (= 5.2.3) + actionpack (6.0.0.rc1) + actionview (= 6.0.0.rc1) + activesupport (= 6.0.0.rc1) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.3) - activesupport (= 5.2.3) + actiontext (6.0.0.rc1) + actionpack (= 6.0.0.rc1) + activerecord (= 6.0.0.rc1) + activestorage (= 6.0.0.rc1) + activesupport (= 6.0.0.rc1) + nokogiri (>= 1.8.5) + actionview (6.0.0.rc1) + activesupport (= 6.0.0.rc1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.3) - activesupport (= 5.2.3) + activejob (6.0.0.rc1) + activesupport (= 6.0.0.rc1) globalid (>= 0.3.6) - activemodel (5.2.3) - activesupport (= 5.2.3) - activerecord (5.2.3) - activemodel (= 5.2.3) - activesupport (= 5.2.3) - arel (>= 9.0) - activestorage (5.2.3) - actionpack (= 5.2.3) - activerecord (= 5.2.3) + activemodel (6.0.0.rc1) + activesupport (= 6.0.0.rc1) + activerecord (6.0.0.rc1) + activemodel (= 6.0.0.rc1) + activesupport (= 6.0.0.rc1) + activestorage (6.0.0.rc1) + actionpack (= 6.0.0.rc1) + activejob (= 6.0.0.rc1) + activerecord (= 6.0.0.rc1) marcel (~> 0.3.1) - activesupport (5.2.3) + activesupport (6.0.0.rc1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) + zeitwerk (~> 2.1, >= 2.1.4) addressable (2.6.0) public_suffix (>= 2.0.2, < 4.0) annotate (2.7.5) activerecord (>= 3.2, < 7.0) rake (>= 10.4, < 13.0) - arel (9.0.0) ast (2.4.0) - autoprefixer-rails (9.5.1) + autoprefixer-rails (9.5.1.1) execjs awesome_print (1.8.0) better_errors (2.5.1) @@ -139,30 +152,32 @@ GEM rack-test (1.1.0) rack (>= 1.0, < 3) rack-timeout (0.5.1) - rails (5.2.3) - actioncable (= 5.2.3) - actionmailer (= 5.2.3) - actionpack (= 5.2.3) - actionview (= 5.2.3) - activejob (= 5.2.3) - activemodel (= 5.2.3) - activerecord (= 5.2.3) - activestorage (= 5.2.3) - activesupport (= 5.2.3) + rails (6.0.0.rc1) + actioncable (= 6.0.0.rc1) + actionmailbox (= 6.0.0.rc1) + actionmailer (= 6.0.0.rc1) + actionpack (= 6.0.0.rc1) + actiontext (= 6.0.0.rc1) + actionview (= 6.0.0.rc1) + activejob (= 6.0.0.rc1) + activemodel (= 6.0.0.rc1) + activerecord (= 6.0.0.rc1) + activestorage (= 6.0.0.rc1) + activesupport (= 6.0.0.rc1) bundler (>= 1.3.0) - railties (= 5.2.3) + railties (= 6.0.0.rc1) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.0.4) loofah (~> 2.2, >= 2.2.2) - railties (5.2.3) - actionpack (= 5.2.3) - activesupport (= 5.2.3) + railties (6.0.0.rc1) + actionpack (= 6.0.0.rc1) + activesupport (= 6.0.0.rc1) method_source rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) + thor (>= 0.20.3, < 2.0) rainbow (3.0.0) rake (12.3.2) rb-fsevent (0.10.3) @@ -171,20 +186,20 @@ GEM regexp_parser (1.4.0) rspec-core (3.8.0) rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) + rspec-expectations (3.8.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) rspec-mocks (3.8.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.8.0) - rspec-rails (3.8.2) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-support (~> 3.8.0) + rspec-rails (4.0.0.beta2) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.8) + rspec-expectations (~> 3.8) + rspec-mocks (~> 3.8) + rspec-support (~> 3.8) rspec-support (3.8.0) rspec_junit_formatter (0.4.1) rspec-core (>= 2, < 4, != 2.12.0) @@ -195,22 +210,11 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.6) - rubocop-performance (1.1.0) - rubocop (>= 0.67.0) + rubocop-performance (1.2.0) + rubocop (>= 0.68.0) ruby-progressbar (1.10.0) ruby_dep (1.5.0) rubyzip (1.2.2) - sass (3.7.3) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.7) - railties (>= 4.0.0, < 6) - sass (~> 3.1) - sprockets (>= 2.8, < 4.0) - sprockets-rails (>= 2.0, < 4.0) - tilt (>= 1.1, < 3) sassc (2.0.1) ffi (~> 1.9) rake @@ -220,7 +224,7 @@ GEM sprockets (> 3.0) sprockets-rails tilt - selenium-webdriver (3.142.0) + selenium-webdriver (3.142.1) childprocess (>= 0.5, < 2.0) rubyzip (~> 1.2, >= 1.2.2) simple_form (4.1.0) @@ -270,6 +274,7 @@ GEM websocket-extensions (0.1.3) xpath (3.2.0) nokogiri (~> 1.8) + zeitwerk (2.1.6) PLATFORMS ruby @@ -292,12 +297,11 @@ DEPENDENCIES puma rack-canonical-host rack-timeout - rails (~> 5.2.3) - rspec-rails + rails (~> 6.0.0.rc1) + rspec-rails (~> 4.0.0.beta2) rspec_junit_formatter rubocop rubocop-performance - sass-rails sassc-rails selenium-webdriver simple_form diff --git a/README.md b/README.md index 32e5b1ef..15e64922 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ Several common features and operational parameters can be set using environment * `PORT` - Port to listen on (default: 3000). * `WEB_CONCURRENCY` - Number of puma workers to spawn (default: 1). * `RAILS_MAX_THREADS` - Threads per worker (default: 5). +* `RAILS_MIN_THREADS` - Threads per worker (default: 5). * `DB_POOL` - Number of DB connections per pool (i.e. per worker) (default: RAILS_MAX_THREADS or 5). * `RAILS_LOG_TO_STDOUT` - Log to standard out, good for Heroku (default: false). * `RAILS_SERVE_STATIC_FILES` - Serve static assets, good for Heroku (default: false). diff --git a/app/assets/javascripts/cable.coffee.example b/app/assets/javascripts/cable.coffee.example deleted file mode 100644 index 07934d02..00000000 --- a/app/assets/javascripts/cable.coffee.example +++ /dev/null @@ -1,11 +0,0 @@ -# Action Cable provides the framework to deal with WebSockets in Rails. -# You can generate new channels where WebSocket features live using the rails generate channel command. -# -# Turn on the cable connection by removing the comments after the require statements (and ensure it's also on in config/routes.rb). -# -#= require action_cable -#= require_self -#= require_tree ./channels -# -# @App ||= {} -# App.cable = ActionCable.createConsumer() diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index a009ace5..d394c3d1 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,2 +1,7 @@ class ApplicationJob < ActiveJob::Base + # Automatically retry jobs that encountered a deadlock + # retry_on ActiveRecord::Deadlocked + + # Most jobs are safe to ignore if the underlying records are no longer available + # discard_on ActiveJob::DeserializationError end diff --git a/bin/bundle b/bin/bundle deleted file mode 100755 index f19acf5b..00000000 --- a/bin/bundle +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__) -load Gem.bin_path('bundler', 'bundle') diff --git a/bin/setup b/bin/setup index bdae43d7..46fd7296 100755 --- a/bin/setup +++ b/bin/setup @@ -1,7 +1,5 @@ #!/usr/bin/env ruby -require "pathname" require "fileutils" -include FileUtils # path to your application root. APP_ROOT = File.expand_path("..", __dir__) @@ -10,21 +8,24 @@ def system!(*args) system(*args) || abort("\n== Command #{args} failed ==") end -chdir APP_ROOT do - # This script is a starting point to setup your application. +FileUtils.chdir APP_ROOT do + # This script is a way to setup or update your development environment automatically. + # This script is idempotent, so that you can run it at anytime and get an expectable outcome. # Add necessary setup steps to this file. puts "== Installing dependencies ==" system! "gem install bundler --conservative" system("bundle check") || system!("bundle install --jobs 4") + + # Install JavaScript dependencies system!("bin/yarn") if File.exist?("yarn.lock") puts "\n== Copying sample files ==" - cp ".env.sample", ".env" unless File.exist?(".env") + FileUtils.cp ".env.sample", ".env" unless File.exist?(".env") puts "\n== Preparing database ==" - system! "bin/rails db:create:all" - system! "bin/rails db:setup db:sample_data" + system! "bin/rails db:prepare" + system! "bin/rails db:sample_data" puts "\n== Removing old logs and tempfiles ==" system! "bin/rails log:clear tmp:clear" diff --git a/bin/update b/bin/update deleted file mode 100755 index ee0dd5d8..00000000 --- a/bin/update +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env ruby -require "pathname" -require "fileutils" -include FileUtils - -# path to your application root. -APP_ROOT = File.expand_path("..", __dir__) - -def system!(*args) - system(*args) || abort("\n== Command #{args} failed ==") -end - -chdir APP_ROOT do - # This script is a way to update your development environment automatically. - # Add necessary update steps to this file. - - puts "== Installing dependencies ==" - system! "gem install bundler --conservative" - system("bundle check") || system!("bundle install --jobs 4") - system!("bin/yarn") if File.exist?("yarn.lock") - - puts "\n== Copying sample files ==" - cp ".env.sample", ".env" unless File.exist?(".env") - - puts "\n== Updating database ==" - system! "bin/rails db:migrate" - - puts "\n== Removing old logs and tempfiles ==" - system! "bin/rails log:clear tmp:clear" - - puts "\n== Restarting application server ==" - system! "bin/rails restart" -end diff --git a/config/application.rb b/config/application.rb index 4c0b7942..0266b769 100644 --- a/config/application.rb +++ b/config/application.rb @@ -9,7 +9,7 @@ module AppPrototype class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 5.2 + config.load_defaults 6.0 # Enable/disable generators. config.generators do |g| diff --git a/config/cable.yml b/config/cable.yml index 342622b9..13aaf42c 100644 --- a/config/cable.yml +++ b/config/cable.yml @@ -2,7 +2,7 @@ development: adapter: async test: - adapter: async + adapter: test production: adapter: redis diff --git a/config/environments/development.rb b/config/environments/development.rb index 1f70aaa4..f067e908 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,6 +16,7 @@ # Run rails dev:cache to toggle caching. if Rails.root.join("tmp", "caching-dev.txt").exist? config.action_controller.perform_caching = true + config.action_controller.enable_fragment_cache_logging = true config.cache_store = :memory_store config.public_file_server.headers = { @@ -27,6 +28,9 @@ config.cache_store = :null_store end + # Store uploaded files on the local file system (see config/storage.yml for options). + config.active_storage.service = :local + # An opinionated ActionMailer config for development: # - If mailcatcher is running when the app boots, use it. # - If not, use Rails' built-in :test delivery-method. @@ -62,7 +66,7 @@ # Suppress logger output for asset requests. config.assets.quiet = true - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true # Use an evented file watcher to asynchronously detect changes in source code, diff --git a/config/environments/production.rb b/config/environments/production.rb index 26ce8bb6..0a7f3a27 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -22,15 +22,12 @@ # Apache or NGINX already handles this. config.public_file_server.enabled = ENV["RAILS_SERVE_STATIC_FILES"].present? - # Compress JavaScripts and CSS. - config.assets.js_compressor = :uglifier + # Compress CSS using a preprocessor. # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. config.assets.compile = false - # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb - # Enable serving of images, stylesheets, and JavaScripts from an asset server. config.action_controller.asset_host = ENV["ASSET_HOST"].presence @@ -38,10 +35,10 @@ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX - # Store uploaded files on the local file system (see config/storage.yml for options) + # Store uploaded files on the local file system (see config/storage.yml for options). config.active_storage.service = :local - # Mount Action Cable outside main process or domain + # Mount Action Cable outside main process or domain. # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] @@ -60,7 +57,7 @@ # config.cache_store = :mem_cache_store # Use a real queuing backend for Active Job (and separate queues per environment) - # config.active_job.queue_adapter = :resque + # config.active_job.queue_adapter = :sidekiq # config.active_job.queue_name_prefix = "app_prototype_#{Rails.env}" config.action_mailer.perform_caching = false @@ -95,4 +92,25 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Inserts middleware to perform automatic connection switching. + # The `database_selector` hash is used to pass options to the DatabaseSelector + # middleware. The `delay` is used to determine how long to wait after a write + # to send a subsequent read to the primary. + # + # The `database_resolver` class is used by the middleware to determine which + # database is appropriate to use based on the time delay. + # + # The `database_resolver_context` class is used by the middleware to set + # timestamps for the last write to the primary. The resolver uses the context + # class timestamps to determine how long to wait before reading from the + # replica. + # + # By default Rails will store a last write timestamp in the session. The + # DatabaseSelector middleware is designed as such you can define your own + # strategy for connection switching and pass that into the middleware through + # these configuration options. + # config.active_record.database_selector = { delay: 2.seconds } + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end diff --git a/config/environments/test.rb b/config/environments/test.rb index 4c308877..44b8ea23 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,11 +1,12 @@ +# The test environment is used exclusively to run your application's +# test suite. You never need to work with it otherwise. Remember that +# your test database is "scratch space" for the test suite and is wiped +# and recreated between test runs. Don't rely on the data there! + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. - # The test environment is used exclusively to run your application's - # test suite. You never need to work with it otherwise. Remember that - # your test database is "scratch space" for the test suite and is wiped - # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + config.cache_classes = false # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that @@ -21,6 +22,7 @@ # Show full error reports and disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.cache_store = :null_store # Raise exceptions instead of rendering exception templates. config.action_dispatch.show_exceptions = false @@ -28,7 +30,7 @@ # Disable request forgery protection in test environment. config.action_controller.allow_forgery_protection = false - # Store uploaded files on the local file system in a temporary directory + # Store uploaded files on the local file system in a temporary directory. config.active_storage.service = :test config.action_mailer.perform_caching = false @@ -43,6 +45,6 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations + # Raises error for missing translations. # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index d3bcaa5e..1b79e310 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -11,6 +11,8 @@ # policy.object_src :none # policy.script_src :self, :https # policy.style_src :self, :https +# # If you are using webpack-dev-server then specify webpack-dev-server host +# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development? # # Specify URI for violation reports # # policy.report_uri "/csp-violation-report-endpoint" diff --git a/config/locales/en.yml b/config/locales/en.yml index decc5a85..cf9b342d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -27,7 +27,7 @@ # 'true': 'foo' # # To learn more, please read the Rails Internationalization guide -# available at http://guides.rubyonrails.org/i18n.html. +# available at https://guides.rubyonrails.org/i18n.html. en: hello: "Hello world" diff --git a/config/puma.rb b/config/puma.rb index 2d9f5aca..ae952c8e 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -4,19 +4,20 @@ # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i -threads threads_count, threads_count +max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } +min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } +threads min_threads_count, max_threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # -port ENV.fetch("PORT") { 3000 } +port ENV.fetch("PORT") { 3000 } # Specifies the `environment` that Puma will run in. # environment ENV.fetch("RAILS_ENV") { "development" } # Specifies the number of `workers` to boot in clustered mode. -# Workers are forked webserver processes. If using threads and workers together +# Workers are forked web server processes. If using threads and workers together # the concurrency of the application would be max `threads` * `workers`. # Workers do not work on JRuby or Windows (both of which do not support # processes). diff --git a/config/routes.rb b/config/routes.rb index 4fdbf973..e55ac501 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do - # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html + # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html root to: "pages#root" end diff --git a/config/spring.rb b/config/spring.rb index 9fa7863f..db5bf130 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,6 +1,6 @@ -%w[ - .ruby-version - .rbenv-vars - tmp/restart.txt - tmp/caching-dev.txt -].each { |path| Spring.watch(path) } +Spring.watch( + ".ruby-version", + ".rbenv-vars", + "tmp/restart.txt", + "tmp/caching-dev.txt" +) diff --git a/db/schema.rb b/db/schema.rb index a6a53fdc..b10373ba 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,18 +1,18 @@ -# encoding: UTF-8 - # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# Note that this schema.rb definition is the authoritative source for your -# database schema. If you need to create the application database on another -# system, you should be using db:schema:load, not running all the migrations -# from scratch. The latter is a flawed and unsustainable approach (the more migrations -# you'll amass, the slower it'll run and the greater likelihood for issues). +# This file is the source Rails uses to define your schema when running `rails +# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 0) do + # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + end