hyperstack-org / hyperstack-org/hyperstack

The active record connection adapter should use migrations instead of auto config

未關閉
#348 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
JavaScript
星號
538
分支
41
PR 合併指標
30 天內沒有已合併 PR

描述

The Connection table AutoConfig keeps causing people problems.

This should be done via a migration that is added by the installer.

In the meantime you can easily turn off the autoconfig by adding this line to the end of your hyperstack.rb initializier:

`def (Hyperstack::Connection).build_tables?; false; end`

This will stop AutoConfig from building the tables, and the whole connection and broadcast mechanism will just not work (but will cause no problems) until the tables exist from the migration.

The migration would look like this:

```ruby
class AddHyperstackTables < ActiveRecord::Migration[5.2]
def change
create_table "hyperstack_connections", force: :cascade do |t|
t.string "channel"
t.string "session"
t.datetime "created_at"
t.datetime "expires_at"
t.datetime "refresh_at"
end

create_table "hyperstack_queued_messages", force: :cascade do |t|
t.text "data"
t.integer "connection_id"
end
end
end
```

Here is some info on creating the migration from the generator:

https://api.rubyonrails.org/classes/Rails/Generators/Migration.html

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。