Skip to content

Commit

Permalink
Update for trilogy (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
petergoldstein committed Jan 2, 2024
1 parent b38eec7 commit f458536
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/database_cleaner/spec/database_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module DatabaseCleaner
module Spec
class DatabaseHelper < Struct.new(:db)
def self.with_all_dbs &block
%w[mysql2 sqlite3 postgres].map(&:to_sym).each do |db|
%w[mysql2 sqlite3 postgres trilogy].map(&:to_sym).each do |db|
yield new(db)
end
end
Expand Down Expand Up @@ -43,7 +43,7 @@ def load_schema
id_column = case db
when :sqlite3
"id INTEGER PRIMARY KEY AUTOINCREMENT"
when :mysql2
when :mysql2, :trilogy
"id INTEGER PRIMARY KEY AUTO_INCREMENT"
when :postgres
"id SERIAL PRIMARY KEY"
Expand Down
9 changes: 9 additions & 0 deletions spec/support/sample.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ mysql2:
port: 3306
encoding: utf8

trilogy:
adapter: trilogy
database: database_cleaner_test
username: root
password:
host: 127.0.0.1
port: 3306
encoding: utf8

postgres:
adapter: postgresql
database: database_cleaner_test
Expand Down

0 comments on commit f458536

Please sign in to comment.