diff --git a/Gemfile b/Gemfile index 571f914..b0b0c90 100644 --- a/Gemfile +++ b/Gemfile @@ -8,8 +8,7 @@ gem "rails", "~> 7.1.3", ">= 7.1.3.4" # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] gem "sprockets-rails" -# Use sqlite3 as the database for Active Record -gem "sqlite3", "~> 1.4" +gem 'pg' # Use the Puma web server [https://github.com/puma/puma] gem "puma", ">= 5.0" @@ -68,8 +67,4 @@ group :test do gem 'simplecov' end -group :production do - gem 'pg' -end - gem 'aws-sdk-s3', '~> 1' diff --git a/Gemfile.lock b/Gemfile.lock index ee3ae4e..2a95dff 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -298,11 +298,6 @@ GEM actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) - sqlite3 (1.7.3-aarch64-linux) - sqlite3 (1.7.3-arm-linux) - sqlite3 (1.7.3-arm64-darwin) - sqlite3 (1.7.3-x86_64-darwin) - sqlite3 (1.7.3-x86_64-linux) stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.7) @@ -359,7 +354,6 @@ DEPENDENCIES selenium-webdriver simplecov sprockets-rails - sqlite3 (~> 1.4) stimulus-rails turbo-rails tzinfo-data diff --git a/config/database.yml b/config/database.yml index 796466b..21d17a8 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,25 +1,68 @@ -# SQLite. Versions 3.8.0 and up are supported. -# gem install sqlite3 -# -# Ensure the SQLite 3 gem is defined in your Gemfile -# gem "sqlite3" -# default: &default - adapter: sqlite3 + adapter: postgresql + encoding: unicode + # For details on connection pooling, see Rails configuration guide + # https://guides.rubyonrails.org/configuring.html#database-pooling pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> - timeout: 5000 development: <<: *default - database: storage/development.sqlite3 + database: blade_ruby_lang_org_development + + #username: blade_ruby_lang_org + #password: + + #host: localhost + #port: 5432 + + # Schema search path. The server defaults to $user,public + #schema_search_path: myapp,sharedapp,public + + # Minimum log levels, in increasing order: + # debug5, debug4, debug3, debug2, debug1, + # log, notice, warning, error, fatal, and panic + # Defaults to warning. + #min_messages: notice -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. test: <<: *default - database: storage/test.sqlite3 + database: blade_ruby_lang_org_test +# As with config/credentials.yml, you never want to store sensitive information, +# like your database password, in your source code. If your source code is +# ever seen by anyone, they now have access to your database. +# +# Instead, provide the password or a full connection URL as an environment +# variable when you boot the app. For example: +# +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" +# +# If the connection URL is provided in the special DATABASE_URL environment +# variable, Rails will automatically merge its configuration values on top of +# the values provided in this file. Alternatively, you can specify a connection +# URL environment variable explicitly: +# +# production: +# url: <%= ENV["MY_APP_DATABASE_URL"] %> +# +# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database +# for a full overview on how database connection configuration can be specified. +# production: - <<: *default - database: storage/production.sqlite3 + primary: &primary_production + <<: *default + database: blade_ruby_lang_org_production + username: blade_ruby_lang_org + password: <%= ENV["R81_PG_DATABASE_PASSWORD"] %> + cache: + <<: *primary_production + database: blade_ruby_lang_org_production_cache + migrations_paths: db/cache_migrate + queue: + <<: *primary_production + database: blade_ruby_lang_org_production_queue + migrations_paths: db/queue_migrate + cable: + <<: *primary_production + database: blade_ruby_lang_org_production_cable + migrations_paths: db/cable_migrate diff --git a/db/schema.rb b/db/schema.rb index 0d0b529..8af5535 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,6 +11,10 @@ # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema[7.1].define(version: 2024_10_10_062050) do + # These are extensions that must be enabled in order to support this database + enable_extension "pg_trgm" + enable_extension "plpgsql" + create_table "messages", force: :cascade do |t| t.string "subject" t.string "from" @@ -19,8 +23,8 @@ t.datetime "updated_at", null: false t.integer "list_id" t.integer "list_seq" - t.datetime "published_at", precision: nil - t.index ["body"], name: "index_messages_on_body" + t.timestamptz "published_at" + t.index ["body"], name: "index_messages_on_body", opclass: :gin_trgm_ops, using: :gin t.index ["list_id", "list_seq"], name: "index_messages_on_list_id_and_list_seq", unique: true end