After deploy:update with Capistrano on our production site, issuing
‘jruby -S rake RAILS_ENV=production db:schema:load’ did not setup the
db correctly.
All entries created with the rails app now have ‘id’ field of value 0
and table contents are not editable from other mysql client.
Only worked correctly after creating schema with mysqladmin and
issuing ‘jruby -S rake RAILS_ENV=production db:migrate’.
Is this expected behavior?
Thanks,
-Kevin
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Tue, Nov 10, 2009 at 10:58 AM, Kevin S. Lim [email protected] wrote:
After deploy:update with Capistrano on our production site, issuing ‘jruby
-S rake RAILS_ENV=production db:schema:load’ did not setup the db correctly.
All entries created with the rails app now have ‘id’ field of value 0 and
table contents are not editable from other mysql client.
Is this the first deploy? Did the database exist on the production
server before you ran db:schema:load? Was the database empty? When you
say “did not setup the db correctly”, were you able to determine what
wasn’t set up?
Only worked correctly after creating schema with mysqladmin and issuing
‘jruby -S rake RAILS_ENV=production db:migrate’.
Is this expected behavior?
db:schema:load in an empty database should set up the tables, but if
you’re doing any DML in your migrations, those would not be picked up
without doing db:migrate.
If you still think there’s a bug looming somewhere, please report back
what versions of JRuby, Rails and AR-JDBC you’re using. Thanks.
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Nov 10, 2009, at 11:45 AM, Nick S. wrote:
Is this the first deploy? Did the database exist on the production
server before you ran db:schema:load? Was the database empty? When you
say “did not setup the db correctly”, were you able to determine what
wasn’t set up?
Actually set up was alright. I will take that back. It created
db_production schema and all the tables were created as wanted.
However it worked strangely when data rows were inserted by the rails
app.
All records were created with id value ‘0’.
Also, when I connect to db using mysql GUI client, edit button was
disabled for all tables.
Only worked correctly after creating schema with mysqladmin and
issuing
‘jruby -S rake RAILS_ENV=production db:migrate’.
Is this expected behavior?
db:schema:load in an empty database should set up the tables, but if
you’re doing any DML in your migrations, those would not be picked up
without doing db:migrate.
Do you mean that I shall invoke both
jruby -S rake RAILS_ENV=production db:schema:load
followed by
jruby -S rake RAILS_ENV=production db:migrate
?
I tried
mysqladmin create db_production
followed by
jruby -S rake RAILS_ENV=production db:migrate
then all worked fine.
But I shall also try db:schema:load and db:migrate combo.
Thanks!
On Tue, Nov 10, 2009 at 5:17 PM, Kevin S. Lim [email protected] wrote:
then all worked fine.
But I shall also try db:schema:load and db:migrate combo.
Usually db:schema:load is only to create the tables. Create database +
db:migrate is usually preferred. If that works for you, stick with
that.
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email