Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails booting up and running PostgreSQL rails tests #1155

Merged
merged 3 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:

services:
postgres:
image: postgres:10
image: postgres:11
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:

services:
postgres:
image: postgres:10
image: postgres:11
env:
POSTGRES_PASSWORD: postgres
POSTGRES_HOST_AUTH_METHOD: trust
Expand Down
4 changes: 4 additions & 0 deletions lib/arjdbc/postgresql/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def supports_insert_on_conflict?
alias supports_insert_on_duplicate_update? supports_insert_on_conflict?
alias supports_insert_conflict_target? supports_insert_on_conflict?

def supports_identity_columns? # :nodoc:
database_version >= 10_00_00 # >= 10.0
end

def index_algorithms
{ concurrently: 'CONCURRENTLY' }
end
Expand Down
10 changes: 6 additions & 4 deletions test/db/postgresql/table_name_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,18 @@ def self.down
end
end

class SerialWithTrigger < ActiveRecord::Base;
class SerialWithTrigger < ActiveRecord::Base
self.table_name = 'serials'
self.primary_key = :sid
end

test 'serial with trigger' do
sn = SerialWithTrigger.create! :value => 1234567890.to_s
def test_serial_with_trigger
pend "Issue happens in active record 7.1 internals, issue wass logged in rails repo"
# issue link: https://github.com/rails/rails/issues/52485

sn = SerialWithTrigger.create!(value: 1_234_567_890.to_s)

assert sn.reload
SerialWithTrigger.columns
end

end
Loading