hyperloop icon indicating copy to clipboard operation
hyperloop copied to clipboard

During the install it should install a migration that created the needed tables

Open johansmitsnl opened this issue 7 years ago • 2 comments

Now when you migrate the database you loose the injected schema. And missing the tables: hyperloop_connections and hyperloop_queued_messages

It should install these 2 migrations:

class InstallHyperloopConnections < ActiveRecord::Migration[5.2]
  def change

    create_table :hyperloop_connections do |t|
      t.string :channel
      t.string :session
      t.datetime :created_at
      t.datetime :expires_at, index: true
      t.datetime :refresh_at
    end


    create_table :hyperloop_queued_messages do |t|
      t.integer :connection_id, index: true
      t.text :data
    end
  end
end

Should there be an index on the channel of session?

johansmitsnl avatar Aug 06 '18 19:08 johansmitsnl

Yes Indeed! This will be done when we transition to the new new Hyperstack architecture.

catmando avatar Aug 07 '18 12:08 catmando

Also a question about the way of installing. Why is this a generate job instead of a normal task like active_storage?

rails active_storage:install             # Copy over the migration needed to the application
rails active_storage:install:migrations  # Copy migrations from active_storage to application

johansmitsnl avatar Aug 07 '18 16:08 johansmitsnl