You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running bin/rake db:schema:load in a project using activerecord-sqlserver-adapter, the process mostly works, with all the tables, indices, and so on being created. However, it fails at the last second with the following error:
rake aborted!
TypeError: can't cast ActiveRecord::ConnectionAdapters::SQLServer::Type::Data
/Users/rpowell/Code/REDACTED/db/schema.rb:13:in `<main>'
-e:1:in `<main>'
Caused by:
TypeError: TypeError
/Users/rpowell/Code/REDACTED/db/schema.rb:13:in `<main>'
-e:1:in `<main>'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)
where line 13 of schema.rb is the outermost call to Schema.define:
Currently I work around this by running db:migrate every time I need to set up a database from scratch, but the Rails team advises against this for a variety of sensible reasons, and I'd prefer to be able to use the Rails-endorsed approach of loading the schema directly.
The text was updated successfully, but these errors were encountered:
@rhysforyou I am looking into this error now... are you working with multiple databases? Can you post your Gemfile or maybe create a minimal application isolating the error?
It has something to do with how Rails handles the AR Internal Metadata table, the error stops occurring when I set use_metadata_table: false in the database.yml.
When running
bin/rake db:schema:load
in a project using activerecord-sqlserver-adapter, the process mostly works, with all the tables, indices, and so on being created. However, it fails at the last second with the following error:where line 13 of
schema.rb
is the outermost call toSchema.define
:Currently I work around this by running
db:migrate
every time I need to set up a database from scratch, but the Rails team advises against this for a variety of sensible reasons, and I'd prefer to be able to use the Rails-endorsed approach of loading the schema directly.The text was updated successfully, but these errors were encountered: