mysql2postgres
mysql2postgres copied to clipboard
sequence owner
suspect that something is lost in translation with regard to primary keys/sequences during the migration.
I've been battling with a strange bug on rails 3.1 where running db:schema:dump was dumping the tables without the "id" primary key specified, e.g.
create_table "activities", :force => true do |t|
was becoming:
create_table "activities", :id => false, :force => true do |t|
This was only happening for tables that were created prior to the migration, so I suspected something was missing in the schema structure and tracked it down to missing owners on the ID sequences - tables added after the migration from mysql had the owner set when I dumped the schema manually, e.g:
ALTER SEQUENCE "accounts_id_seq" OWNED BY "accounts"."id";
Those that were ported from MySQL did not.
Possibly related to #31