David Heinemeier Hansson
2006-Feb-10 05:04 UTC
Be a hero: Convert Active Record fixtures to schema.rb
I''ve started for a few new tests to use schema.rb instead of creating a gazillion changes to all the db-specific .sql files. Great stuff. But it would be even greater if ALL of the db-specific fixtures were replaced by entries in schema.rb. Should not be a too hard task. Anyone up for it? -- David Heinemeier Hansson http://www.loudthinking.com -- Broadcasting Brain http://www.basecamphq.com -- Online project management http://www.backpackit.com -- Personal information manager http://www.rubyonrails.com -- Web-application framework
Kevin Clark
2006-Feb-10 05:25 UTC
Re: Be a hero: Convert Active Record fixtures to schema.rb
I''ll give it a shot. Is there a reason we can''t load up the individual schema to a db and use schema dumper? Clean up if needed? Kev On 2/9/06, David Heinemeier Hansson <david.heinemeier@gmail.com> wrote:> I''ve started for a few new tests to use schema.rb instead of creating > a gazillion changes to all the db-specific .sql files. Great stuff. > But it would be even greater if ALL of the db-specific fixtures were > replaced by entries in schema.rb. Should not be a too hard task. > Anyone up for it? > -- > David Heinemeier Hansson > http://www.loudthinking.com -- Broadcasting Brain > http://www.basecamphq.com -- Online project management > http://www.backpackit.com -- Personal information manager > http://www.rubyonrails.com -- Web-application framework > _______________________________________________ > Rails-core mailing list > Rails-core@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-core >
Michael Koziarski
2006-Feb-10 05:26 UTC
Re: Be a hero: Convert Active Record fixtures to schema.rb
On 2/10/06, Kevin Clark <kevin.clark@gmail.com> wrote:> I''ll give it a shot. Is there a reason we can''t load up the individual > schema to a db and use schema dumper? Clean up if needed? > KevIt''s also about making sure that the rake test_x loads the schema, and runs the tests. But I think you''ve just given away a secret implementation strategy ;) -- Cheers Koz
Kevin Clark
2006-Feb-10 05:29 UTC
Re: Be a hero: Convert Active Record fixtures to schema.rb
Ok, yes, I''ll take a look. Incidentally, does anyone know how to resolve Rendezvous/Bonjour hostnames in Ruby? I tried using the DNSSD library, but the resolve function doesn''t seem to do anything at all. Kev On 2/9/06, Michael Koziarski <michael@koziarski.com> wrote:> On 2/10/06, Kevin Clark <kevin.clark@gmail.com> wrote: > > I''ll give it a shot. Is there a reason we can''t load up the individual > > schema to a db and use schema dumper? Clean up if needed? > > Kev > > It''s also about making sure that the rake test_x loads the schema, and > runs the tests. > > But I think you''ve just given away a secret implementation strategy ;) > > -- > Cheers > > Koz >
Wilson Bilkovich
2006-Feb-10 14:35 UTC
Re: Be a hero: Convert Active Record fixtures to schema.rb
On 2/10/06, David Heinemeier Hansson <david.heinemeier@gmail.com> wrote:> I''ve started for a few new tests to use schema.rb instead of creating > a gazillion changes to all the db-specific .sql files. Great stuff. > But it would be even greater if ALL of the db-specific fixtures were > replaced by entries in schema.rb. Should not be a too hard task. > Anyone up for it? > --Is this possible for systems (like Oracle) that don''t have schema dump support yet? ..or did I miss some breaking news somewhere? Either way, I''m happy to help. Adding a new table as a fixture for every adapter once was enough for me. I can only imagine what it''s like for the core team.
Michael Schoen
2006-Feb-10 18:56 UTC
Re: Be a hero: Convert Active Record fixtures to schema.rb
> Is this possible for systems (like Oracle) that don''t have schema dump > support yet? > ..or did I miss some breaking news somewhere?I believe Oracle supports all the migrations methods now. If I''ve missed something please let me know.
Wilson Bilkovich
2006-Feb-10 20:39 UTC
Re: Be a hero: Convert Active Record fixtures to schema.rb
On 2/10/06, Michael Schoen <schoenm@earthlink.net> wrote:> > Is this possible for systems (like Oracle) that don''t have schema dump > > support yet? > > ..or did I miss some breaking news somewhere? > > I believe Oracle supports all the migrations methods now. If I''ve missed > something please let me know. >Perhaps I''m just misunderstanding how this works. I have this in environment.rb: config.active_record.schema_format = :ruby ..and "rake db_schema_dump" produces a schema.rb file that contains only this: ActiveRecord::Schema.define(:version => 10) do end The migrations themselves work fine, though.. this project was built without any manual table creation. Oh wait, I just figured it out. It''s because the application logs in as a user that gets to the tables via synonyms. I changed it to log in as the DBA, and now it can (mostly) dump the schema. I do get this error, though, right at the end: # Could not dump table "spending_plans" because of following StandardError # Unknown type ''LONG'' for column ''comment_text'' Has that been changed since I did this setup? I remember looking at the schema definition code for Oracle in trunk, and wondering what LONG was all about. Is there a way to make the schema dumper aware of synonyms? Thanks, --Wilson.