mysql2postgres icon indicating copy to clipboard operation
mysql2postgres copied to clipboard

sequence owner

Open tekin opened this issue 12 years ago • 1 comments

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.

tekin avatar Sep 23 '11 14:09 tekin

Possibly related to #31

paazmaya avatar Aug 21 '16 09:08 paazmaya