Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dump one DB with multiple schemas #836

Open
TulioMagnus opened this issue May 20, 2020 · 1 comment
Open

Dump one DB with multiple schemas #836

TulioMagnus opened this issue May 20, 2020 · 1 comment

Comments

@TulioMagnus
Copy link

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


@wpolicarpo
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants