rails-sqlserver / activerecord-sqlserver-adapter

SQL Server Adapter For Rails
MIT License
968 stars 557 forks source link

Dump one DB with multiple schemas #836

Open TulioMagnus opened 4 years ago

TulioMagnus commented 4 years ago

Issue

I'm trying to dump all schemas from a legacy db (not on my machine), it's just one db. But the only schema i get is dbo and it's tables.

I'm using in config/application.rb: config.active_record.schema_format = :sql

Expected behavior

run rails db:structure:dump, or schema:dump and get the tables from the schemas Ticket and Security.

Actual behavior

Tinytds uses defncopy and i only get dbo schema with EFMigrationhistory and sysdiagrams tables.

Details

wpolicarpo commented 2 years ago

Sorry for the long response time.

So just to be clear, you have 2 models say ModelA and ModelB, one in the dbo schema and the other in another schema, right?

You said it's a legacy application so I assume you are using self.table_name= to set the table name for those models?

Could you maybe post more details about the whole setup? Which model goes into with schema, how you are setting the table names, etc?