activerecord-sqlserver-adapter
activerecord-sqlserver-adapter copied to clipboard
Support for multiple schema types when dumping schema; potential fix for #317
This is what I got. PR for specs and questions.
This PR allows rake db:schema:dump to dump the database schema for all microsoft table schemas.
It does this through exposing a method that can be monkey patched in an initializer:
module ActiveRecord
module ConnectionAdapters
class SQLServerAdapter < AbstractAdapter
def configure_connection
raw_connection_do "SET TEXTSIZE #{64.megabytes}"
end
def configure_application_name
"myapp_#{$$}_#{Thread.current.object_id}".to(29)
end
end
module SQLServer
module SchemaStatements
def server_schema
['dbo', 'schema2', 'schema3']
end
end
end
end
end
A couple of questions I have, because I don't know the internals of sql server super well.
- Should the
dboschema always be present in theinformation_schema.tablesquery? - Is there a way to put the alternative schemas in the database.yml file that you know of?
- When writing to the schema.rb should we include the
[schema_name].in thecreate_tabledefinition? 3b. How do we create the table in the same schema it was dumped in duringrake db:schema:load?
@alexggordon can you:
- Explain better what you want to achieve this this and maybe give an example
- Rebase your branch if you want to go ahead this this?
Closing as stale