sql server - Rails sqlserver schema dump not generating primary key for non identity pk's -


given these 2 tables

create table [dbo].[astrology_sign](   [sign_id] [int] not null,  constraint [pk_astrology_sign] primary key nonclustered    create table [dbo].[activity_master](   [activity_id] [int] identity(1,1) not null,  constraint [pk_activity_master] primary key nonclustered  

rails generates following 2 entries in schema.rb

create_table "astrology_sign", :id => false, :force => true |t| create_table "activity_master", :primary_key => "activity_id", :force => true |t| 

trying use schema move sqlserver postgres giving me issues. there lot of tables , rather not have edit hand.

friend may you... there relations tables , columns in sqlserver join relations. look:

select * information_schema.tables join information_schema.columns on  information_schema.tables.table_name = information_schema.columns.table_name 

with information, can program little program convert those. meant can access information tables , columns , replacing them in string, string query in postgres .look:

for(every table in information_schema.tables ) {     string postgres_query = "create_table " + table_name + ", :id => false, :force => true |t|"     exec(postgres_query) } 

and execute every table datacenter(postgres) . of course have optimize want.you know not right code


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -