Skip to content

Commit

Permalink
Include column definitions in schema dump if the column name is not `…
Browse files Browse the repository at this point in the history
…id` (#173)
  • Loading branch information
danielwestendorf authored Oct 23, 2024
1 parent e216bcb commit a4c696a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/clickhouse-activerecord/schema_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def table(table, stream)
if simple || !match
columns.each do |column|
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type)
next if column.name == pk
next if column.name == pk && column.name == "id"
type, colspec = column_spec(column)
name = column.name =~ (/\./) ? "\"`#{column.name}`\"" : column.name.inspect
tbl.print " t.#{type} #{name}"
Expand Down

0 comments on commit a4c696a

Please sign in to comment.