tag:blogger.com,1999:blog-11593374.post2998366881152445499..comments2024-03-22T08:46:57.166+00:00Comments on Andrew Beacock's Blog: Why do Rails Migrations cause the database schema to be dumped into schema.rb?Andrew Beacockhttp://www.blogger.com/profile/01039992884679308726noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-11593374.post-30080026369453482342010-02-08T20:48:36.946+00:002010-02-08T20:48:36.946+00:00You should reconsider disabling the schema dump. I...You should reconsider disabling the schema dump. It is recommended to check schema.rb (or development_structure.sql) into your source control system and use it, and not the historical migrations, to build up a new database.<br /><br />Migrations are great for incremental changes, but they are fragile and will often break if you reference models directly from them.Steve Madsenhttp://lightyearsoftware.com/noreply@blogger.comtag:blogger.com,1999:blog-11593374.post-14579535220681033402009-11-06T16:12:31.793+00:002009-11-06T16:12:31.793+00:00And - the schema dump code that creates schema.rb ...And - the schema dump code that creates schema.rb is faulty. If you set :id => false in the table creation and then create a field called "id" that's not the same spec as the AR Migrations default primary key spec for your table, schema.rb will blithely create an "id" field with the AR default spec, and you'll have tests that fail and fixtures that won't work.Nostrum Forderhttps://www.blogger.com/profile/05541886620108383181noreply@blogger.comtag:blogger.com,1999:blog-11593374.post-78000908094425279582008-06-25T23:41:00.000+01:002008-06-25T23:41:00.000+01:00careful - rake test uses schema.rb to create the t...careful - rake test uses schema.rb to create the test db and then loads the fixture data into it.Anonymousnoreply@blogger.com