Redshift schema dumper doesn't dump primary_key on `schema_migrations`
bradrobertson opened this issue · 6 comments
bradrobertson commented
I get this after migration
-
+
create_table!(:schema_migrations) do
- String :filename, :null=>false
-
- primary_key [:filename]
+ String :filename, :size=>255, :null=>false
end
sachinsiby commented
The reason for this is because in our Redshift adapter's schema_parse_table
method, we had to modify it to assume that only columns named id
are primary keys.
bradrobertson commented
So is it fixable?
sachinsiby commented
Working on changing it to use "filename" for when the table name is schema_migrations
bradrobertson commented
Is that really the solution? Why are we locked down to id
being the primary key?
bradrobertson commented
Ok for now we'll look at the table_name to make sure filename
is the primary key for schema_migrations
. I've logged a bug about fixing all of this and allowing any key name to be the primary key (future consideration).
gabrielmansour commented
^ This was me. GitHub thinks I'm Shane for some reason.