This project is archived and is in readonly mode.
[Patch] Rails schema_format :sql should behave like schema_format :ruby
-
Nick Gauthier
- Title changed from Rails schema_format :sql should behave like schema_format :ruby to [Patch] Rails schema_format :sql should behave like schema_format :ruby
-
Dave Hoover
This seems like exactly what I need (since we switched to schema_format = :sql) but I'm wondering why you switched to structure.sql from {env}_structure.sql.
-
Nick Gauthier
Because if I migrate the dev db, then run the tests, if I left it with env_structure if would do this:
1) Run db/migrate
=> updated dev_structure.sql 2) Run tests
=> load from test_structure.sql (FILE MISSING)But if you just use structure.sql (like schema.rb), then they can use the same structure file.
The main reason can be summarize to: I want to mimic schema dumping and loading as closely as possible.
-Nick Gauthier
-
Dave Hoover
Thanks Nick.
And BTW, great job on your talk at Windy City Rails. I couldn't be there, but I heard it was one of the better talks of the day. :)
-
Gaius Centus Novus
See also #5889 [Patch] Rails 2.3 schema_format :sql should behave like schema_format :ruby, which backports these changes to Rails 2.3
-
Xavier Shay
Good. I support this patch.
-
Gabriel Sobrinho
Waiting for this patch too.
This patch apply for rails 3?
-
Gravis
+1 for this patch/feature thanks
-
William Denniss
+1 I would really like to see the sql option become a first class citizen, especially since it is presented that way in the docs ( http://guides.rubyonrails.org/migrations.html#types-of-schema-dumps )
-
Tyler Hunt
+1
-
Ed Schmalzle
+1
-
Chris Cahoon
+1
-
Flip Sasser
+1
-
Andreas Korth
+1 fwiw
-
Brian Morearty
+1 woo hoo
-
Brad Langhorst
updated the patch so that it uses the logic in test:clone_structure for db:structure:load instead of executing the lines in the structure file. test:clone_structure now uses db:structure:load just like test:clone does to db:schema:load
fixed things so that setup loads the environment before trying to use it where necessary (db:reset and db:setup)
added respect for the PGUSER environment variable, eliminating the -U from dump and load statements (needed for trust and ident authentication)
patch is diffed against rails 2.3.11.
-
Greg Hazel
+1
