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

Fixes for schema_names and column_definition.null #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion activerecord6-redshift-adapter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.files = Dir.glob(['LICENSE', 'README.md', 'lib/**/*.rb'])
s.require_path = 'lib'

s.required_ruby_version = '>= 3.0'
s.required_ruby_version = '>= 2.7'
s.add_runtime_dependency 'activerecord', '~> 7.0'
s.add_runtime_dependency 'pg', '~> 1.0'
end
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def columns(table_name)
default_value = extract_value_from_default(default)
type_metadata = fetch_type_metadata(column_name, type, oid, fmod)
default_function = extract_default_function(default_value, default)
new_column(column_name, default_value, type_metadata, notnull == 'f', table_name, default_function)
new_column(column_name, default_value, type_metadata, !notnull, table_name, default_function)
end
end

Expand Down Expand Up @@ -185,7 +185,7 @@ def ctype; end

# Returns an array of schema names.
def schema_names
select_value(<<-SQL, 'SCHEMA')
select_values(<<-SQL, 'SCHEMA')
SELECT nspname
FROM pg_namespace
WHERE nspname !~ '^pg_.*'
Expand Down
4 changes: 2 additions & 2 deletions lib/active_record/connection_adapters/redshift_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -762,8 +762,8 @@ def construct_coder(row, coder_class)
coder_class.new(oid: row['oid'].to_i, name: row['typname'])
end

def create_table_definition(*args) # :nodoc:
Redshift::TableDefinition.new(self, *args)
def create_table_definition(name, **options) # :nodoc:
Redshift::TableDefinition.new(self, name, **options)
end
end
end
Expand Down