From fd7a0449c21d0bb5467f05ec15d78dd965a88abf Mon Sep 17 00:00:00 2001 From: Template Bot Date: Sun, 20 Sep 2026 03:03:05 +0000 Subject: [PATCH] set up SolidCable Source: https://github.com/mockdeep/Rails-Template/pull/1494 --- Gemfile | 2 ++ Gemfile.lock | 14 ++++++++++++++ ...20260920022633_create_solid_cable_tables.rb | 18 ++++++++++++++++++ db/schema.rb | 12 +++++++++++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20260920022633_create_solid_cable_tables.rb diff --git a/Gemfile b/Gemfile index 489530916..def51d386 100644 --- a/Gemfile +++ b/Gemfile @@ -27,6 +27,8 @@ gem "puma" gem "rack-ssl" gem "sass" gem "scout_apm" +gem "solid_cable" +gem "solid_queue" gem "stimulus-rails" gem "stripe" gem "strong_migrations" diff --git a/Gemfile.lock b/Gemfile.lock index 147d8d691..471fea4f3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -385,6 +385,18 @@ GEM shoulda-matchers (8.0.1) activesupport (>= 7.2) simplecov (1.2.0) + solid_cable (4.0.2) + actioncable (>= 7.2) + activejob (>= 7.2) + activerecord (>= 7.2) + railties (>= 7.2) + solid_queue (1.7.0) + activejob (>= 7.1) + activerecord (>= 7.1) + concurrent-ruby (>= 1.3.1) + fugit (~> 1.11) + railties (>= 7.1) + thor (>= 1.3.1) stimulus-rails (1.3.4) railties (>= 6.0.0) stripe (19.6.1) @@ -482,6 +494,8 @@ DEPENDENCIES selenium-webdriver shoulda-matchers simplecov + solid_cable + solid_queue stimulus-rails stripe strong_migrations diff --git a/db/migrate/20260920022633_create_solid_cable_tables.rb b/db/migrate/20260920022633_create_solid_cable_tables.rb new file mode 100644 index 000000000..981d464e3 --- /dev/null +++ b/db/migrate/20260920022633_create_solid_cable_tables.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# Copied from the schema generated by `rails solid_cable:install`, so the cable +# table can live in the primary database. +class CreateSolidCableTables < ActiveRecord::Migration[8.1] + def change + create_table "solid_cable_messages" do |t| + t.binary "channel", limit: 1024, null: false + t.binary "payload", limit: 536_870_912, null: false + t.datetime "created_at", null: false + t.integer "channel_hash", limit: 8, null: false + t.index ["channel"], name: "index_solid_cable_messages_on_channel" + t.index ["channel_hash"], + name: "index_solid_cable_messages_on_channel_hash" + t.index ["created_at"], name: "index_solid_cable_messages_on_created_at" + end + end +end diff --git a/db/schema.rb b/db/schema.rb index f5df8f42b..62c9155d5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.1].define(version: 2026_06_09_120000) do +ActiveRecord::Schema[8.1].define(version: 2026_09_20_022633) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" enable_extension "pgcrypto" @@ -133,6 +133,16 @@ t.index ["type"], name: "index_settings_on_type", unique: true end + create_table "solid_cable_messages", force: :cascade do |t| + t.binary "channel", null: false + t.bigint "channel_hash", null: false + t.datetime "created_at", null: false + t.binary "payload", null: false + t.index ["channel"], name: "index_solid_cable_messages_on_channel" + t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash" + t.index ["created_at"], name: "index_solid_cable_messages_on_created_at" + end + create_table "stories", id: :serial, force: :cascade do |t| t.text "body" t.datetime "created_at", null: false