Sha256: c7557f570e29c7e12ec39fc7f69f07dce2e4830198da4273dde75e395eac1a40

Contents?: true

Size: 925 Bytes

Versions: 7

Compression:

Stored size: 925 Bytes

Contents

# frozen_string_literal: true

require "logger"

DB = Sequel.connect(ENV.fetch("DB_URL", "postgres:///sequel_plugins"))
DB.logger = Logger.new("log/db.log")

Sequel::Model.db = DB

DB.extension :pg_array
DB.extension :pg_json
DB.extension :pg_range

DB.extension :currency_rates
DB.extension :pg_tools
DB.extension :slave
DB.extension :set_local
DB.extension :synchronize

Sequel.extension :deferrable_foreign_keys
Sequel.extension :migration
Sequel.extension :pg_array_ops
Sequel.extension :pg_json_ops
Sequel.extension :pg_range_ops

Sequel::Model.plugin :attr_encrypted
Sequel::Model.plugin :duplicate
Sequel::Model.plugin :get_column_value
Sequel::Model.plugin :money_accessors
Sequel::Model.plugin :store_accessors
Sequel::Model.plugin :synchronize
Sequel::Model.plugin :upsert
Sequel::Model.plugin :with_lock

def clean_database!
  DB.tables.each do |table_name|
    DB.drop_table?(table_name, cascade: true)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
umbrellio-sequel-plugins-0.13.0.172 utils/database.rb
umbrellio-sequel-plugins-0.13.0 utils/database.rb
umbrellio-sequel-plugins-0.12.0.169 utils/database.rb
umbrellio-sequel-plugins-0.12.0 utils/database.rb
umbrellio-sequel-plugins-0.12.0.159 utils/database.rb
umbrellio-sequel-plugins-0.11.0.143 utils/database.rb
umbrellio-sequel-plugins-0.10.0.100 utils/database.rb