Schema dump not working when using sql schema prefixes


#1

I am running ruby 2.0.0p247 (2013-06-27) [i386-mingw32] / rails 4.2.5

Because of the way we will be doing things, I am using one sql database
on the server with schema prefixes. i.e. a joblist app would use jl. as
the schema prefix.

I noticed that when I did this, migrations and schema dumps no longer
seem to work properly.

Application.rb has
config.active_record.table_name_prefix = ‘rl.’
config.active_record.schema_format = :sql

Part of my database YML is
development:
adapter: sqlserver
port: 1435
schema_search_path: rl

If I run a rake task of db structure dump for default with a full
backtrace, I get

===================================================
C:\Ruby200\bin\ruby.exe -e
$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)
C:/Users/cmendla/RubymineProjects/research_library/bin/rake --trace
db:structure:dump
** Invoke db:structure:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:structure:dump
rake aborted!
Error dumping database
C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-sqlserver-adapter-4.2.4/lib/active_record/tasks/sqlserver_database_tasks.rb:64:in
structure_dump' C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:182:instructure_dump’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:279:in
block (3 levels) in <top (required)>' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:incall’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:240:in
block in execute' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:ineach’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:235:in
execute' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain’
C:/Ruby200/lib/ruby/2.0.0/monitor.rb:211:in mon_synchronize' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/task.rb:165:in
invoke' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:150:ininvoke_task’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in
block (2 levels) in top_level' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:ineach’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:106:in
block in top_level' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:115:inrun_with_threads’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:100:in
top_level' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:78:inblock in run’
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:176:in
standard_exception_handling' C:/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.4.2/lib/rake/application.rb:75:inrun’
C:/Users/cmendla/RubymineProjects/research_library/bin/rake:4:in <top (required)>' -e:1:inload’
-e:1:in `’
Tasks: TOP => db:structure:dump

Process finished with exit code 1

================================================================

A schema dump does not work either. However, a schema cache dump does.

==============================================================

U:=ActiveRecord::ConnectionAdapters::SQLServer::SchemaCache[i {I"[advanced_searches]:ET[ I"[attachments];T[ I"[authors];T[
I"[categories];T[ I"[ckeditor_assets];T[ I"[documents];T[
I"[help_requests];T[ I"[messages];T[ I"[QMW_Tracking_Log];T[
I"[reviewers];T[ I"[salespeople];T[ I"[schema_migrations];T[
I"[searches];T[ I"[tags];T[ I"[technicians];T[ I"[tests];T[ I"[users];T[
I"[rl].[schema_migrations];T[o:6ActiveRecord::ConnectionAdapters::SQLServerColumn:
@nameI"version;T:@cast_typeo:FActiveRecord::ConnectionAdapters::SQLServer::Type::UnicodeVarchar:@precision0:@scale0:@limiti�:@sql_typeI"nvarchar(4000);T:
@nullF:
@default0:@default_function0:@sqlserver_options{
:ordinal_positioni:is_primaryF:is_identityF:default_function0:table_nameI"rl.schema_migrations;T{I"[advanced_searches];T{
I"[attachments];T{ I"[authors];T{ I"[categories];T{
I"[ckeditor_assets];T{ I"[documents];T{ I"[help_requests];T{
I"[messages];T{ I"[QMW_Tracking_Log];T{ I"[reviewers];T{
I"[salespeople];T{ I"[schema_migrations];T{ I"[searches];T{ I"[tags];T{
I"[technicians];T{ I"[tests];T{ I"[users];T{
{I"[advanced_searches];T0I"[attachments];T0I"[authors];T0I"[categories];T0I"[ckeditor_assets];T0I"[documents];T0I"[help_requests];T0I"[messages];T0I"[QMW_Tracking_Log];T0I"[reviewers];T0I"[salespeople];T0I"[schema_migrations];T0I"[searches];T0I"[tags];T0I"[technicians];T0I"[tests];T0I"[users];T0{I"[advanced_searches];TTI"[attachments];TTI"[authors];TTI"[categories];TTI"[ckeditor_assets];TTI"[documents];TTI"[help_requests];TTI"[messages];TTI"[QMW_Tracking_Log];TTI"[reviewers];TTI"[salespeople];TTI"[schema_migrations];TTI"[searches];TTI"[tags];TTI"[technicians];TTI"[tests];TTI"[users];TT{I"[advanced_searches];TFI"[attachments];TFI"[authors];TFI"[categories];TFI"[ckeditor_assets];TFI"[documents];TFI"[help_requests];TFI"[messages];TFI"[QMW_Tracking_Log];TFI"[reviewers];TFI"[salespeople];TFI"[schema_migrations];TFI"[searches];TFI"[tags];TFI"[technicians];TFI"[tests];TFI"[users];TFI"[rl].[schema_migrations];TF{

======================================================================

I saw some posts that seem to indicate that this is a known issue with
rails. Can anyone tell me how to get the schema dumps working?

thanks

chris