activerecord-sqlserver-adapter icon indicating copy to clipboard operation
activerecord-sqlserver-adapter copied to clipboard

Dump one DB with multiple schemas

Open TulioMagnus opened this issue 5 years ago • 1 comments

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

  • Rails version: 5.2.4.2

  • SQL Server adapter version: 5.2.1

  • TinyTDS version: 2.1

Compile-time settings (established with the "configure" script) Version: freetds v1.00.82 freetds.conf directory: /etc/freetds MS db-lib source compatibility: no Sybase binary compatibility: yes Thread safety: yes iconv library: yes TDS version: 4.2 iODBC: no unixodbc: yes SSPI "trusted" logins: no Kerberos: yes OpenSSL: no GnuTLS: yes MARS: no


TulioMagnus avatar May 20 '20 12:05 TulioMagnus

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?

wpolicarpo avatar Jul 29 '21 12:07 wpolicarpo