-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hash channel to have a more compact index
- Loading branch information
Showing
12 changed files
with
73 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Description: | ||
Updates Solid Cable migrations | ||
|
||
Example: | ||
bin/rails generate solid_cable:update | ||
|
||
This will perform the following: | ||
Installs new Solid Cable migrations |
13 changes: 13 additions & 0 deletions
13
lib/generators/solid_cable/update/templates/db/migrate/create_compact_channel.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class CreateCompactChannel < ActiveRecord::Migration[7.2] | ||
def change | ||
change_column :solid_cable_messages, :channel, | ||
:binary, limit: 1024, null: false | ||
add_column :solid_cable_messages, :channel_hash, | ||
:integer, limit: 8, null: false | ||
add_index :solid_cable_messages, :channel_hash | ||
change_column :solid_cable_messages, :payload, | ||
:binary, limit: 536_870_912, null: false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
class SolidCable::UpdateGenerator < Rails::Generators::Base | ||
source_root File.expand_path("templates", __dir__) | ||
|
||
def copy_files | ||
migration_template "db/migrate/create_compact_channel", | ||
"db/cable_migrate/create_compact_channel" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
test/dummy/db/migrate/20240823212657_create_solid_cable_message.solid_cable.rb
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
test/dummy/db/migrate/20240823212658_index_channels.solid_cable.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters