Kathleen,

I would plan to manage this via migrations.  Migrations are a great
way to manage your database, especially since they are wired into the
ActiveRecord mechanism of Rails.  Generally speaking you use the
'self.up' method to define the database creation activity and the
'self.down' method to reset the database to the state is was in prior
to executing 'self.up'.  For instance:

In the following example migration I create a simple table and also
create the 'self.down' method to undo this creation.

<code>
class Issues < ActiveRecord::Migration
  def self.up
    create_table :issues, :primary_key => :issue_id do |t|
      t.column :issue_id, :integer, :null => false
      t.column :name, :string, :limit => 255
      t.column :description, :text
      t.column :created_at, :timestamp
      t.column :updated_at, :timestamp
    end

    add_index :issues, :issue_id, :unique => true
  end

  def self.down
    drop_table :issues
  end
end
</code>

I hope this helps.

Regards,
John Sextro

On Mar 2, 8:21 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi Group,
> I am very excited about starting my next application using Heroku and
> am trying to think this through first.
> My last Ruby on Rails application took about a year to complete and
> was HUGH. In this time I would often delete my database in the MySQL
> Query Program and then re-migrate it all back in as I spent great
> effort building good exemplary data.
> I visualize that Heroku keeps the MySQL database for us and I've seen
> in the demo how we can view one specific table and edit or delete
> records.
> How (or can it be done) delete all records in the database and begin
> anew?
> I am grateful for your reply.
> Kathleen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to