Ruby on Rails Wednesday, April 28, 2010

Hai Rick,

I have made the change you hav told. Still the join table is not been
populated.
These are my migration data.Is there any problem with this?
.....................................................
class CreateNewStations < ActiveRecord::Migration
def self.up
create_table :stations do |t|
t.string :name
t.integer :district_id
t.string :MDT_id
t.string :sim_no
t.decimal :longitude, :precision=>10, :scale=>6
t.decimal :latitude, :precision=>10, :scale=>6
t.integer :user_id
t.timestamps

end
create_table :stations_users, :id => false do |t|
t.integer :user_id
t.integer :station_id
end
end

def self.down
drop_table :stations_users rescue nil
drop_table :stations
end
end
...........................................................

class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :name
t.string :username
t.string :hashed_password
t.string :salt
t.string :status
t.string :phone
t.string :email
t.integer :station_id
t.timestamps
end
end

def self.down
drop_table :users
end
end

Thanks and Regards,
Veena
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment