File: postgresql.rb

package info (click to toggle)
ruby-ahoy-matey 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 380 kB
  • sloc: ruby: 1,303; makefile: 3
file content (26 lines) | stat: -rw-r--r-- 778 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
ActiveRecord::Base.establish_connection adapter: "postgresql", database: "ahoy_test"

ActiveRecord::Migration.enable_extension "hstore"

ActiveRecord::Migration.create_table :postgresql_hstore_events, force: true do |t|
  t.hstore :properties
end

ActiveRecord::Migration.create_table :postgresql_json_events, force: true do |t|
  t.json :properties
end

ActiveRecord::Migration.create_table :postgresql_jsonb_events, force: true do |t|
  t.jsonb :properties
  t.index :properties, using: :gin
end

ActiveRecord::Migration.create_table :postgresql_text_events, force: true do |t|
  t.text :properties
end

class PostgresqlBase < ActiveRecord::Base
  include Ahoy::QueryMethods
  establish_connection adapter: "postgresql", database: "ahoy_test"
  self.abstract_class = true
end