influitive/blueshift

Redshift schema dumper doesn't dump primary_key on `schema_migrations`

bradrobertson opened this issue · 6 comments

I get this after migration

-
+
     create_table!(:schema_migrations) do
-      String :filename, :null=>false
-
-      primary_key [:filename]
+      String :filename, :size=>255, :null=>false
     end

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.

So is it fixable?

Working on changing it to use "filename" for when the table name is schema_migrations

Is that really the solution? Why are we locked down to id being the primary key?

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).

^ This was me. GitHub thinks I'm Shane for some reason.