similar to: Migrations + foreign keys

Displaying 20 results from an estimated 600 matches similar to: "Migrations + foreign keys"

2006 May 25
24
Make these a prt of Ruby on Rails!
3 things that should be part of the main Rails tree: http://www.redhillconsulting.com.au/rails_plugins.html Views? -- Posted via http://www.ruby-forum.com/.
2006 Jun 21
1
Migration with foreign key won''t work
Hi all I use the plugin which supports foreign keys with migrations: http://wiki.rubyonrails.org/rails/pages/Foreign+Key+Schema+Dumper+Plugin/versions/12 I have created the following migration file: class AddArtistsTable < ActiveRecord::Migration def self.up create_table :artists, :force => true do |t| t.column :name, :string, :limit => 100 t.column :artist_type_id,
2005 Jun 29
4
Problem connecting to MySQL
Hello, when I invoke an action of my rails web app I recieve this message: No such file or directory - /tmp/mysql.sock In my MySQL config file I have this line: socket=/var/lib/mysql/mysql.sock Why Rails doesn''t pick up this value instead of his default value? How could I change the configuration of Rails in order to change that value? -- / Eduardo Yáñez Parareda /
2006 Jul 19
4
Using Application.rhtml as layout for all controllers
I put my nav system in application layout. that way any controller loading will have the nav system. I have one problem though - the <%= yield %> is in the body, so how would my controllers specify other css files? my application layout would look like this: <html> <head> title css include javascript include </head> <body> nav system <%=yield%>
2006 Aug 16
14
Migrations: only one table per migration file?
Hi all I have a new migration file created that adds some tables and fills one with some data: create_table :sound_styles do |t| t.column :name, :string, :null => false end create_table :show_types do |t| t.column :name, :string, :null => false end create_table :countries do |t| t.column :name, :string, :null => false end ActionView::Helpers::FormOptionsHelper::COUNTRIES.each
2006 Jul 10
3
Can migrations set up foreign key references?
I use Oracle and i really want to use migrations, but there seems to be no way to setup foreign key constraints. Is this true? If it is then doesn''t that make migrations useles with Oracle? Thanks Chris -- Posted via http://www.ruby-forum.com/.
2006 Aug 14
2
Another try with REST
I''m using edge rails. My routes.rb is: map.connect '':controller/service.wsdl'', :action => ''wsdl'' # Install the default route as the lowest priority. map.connect '':controller/:action/:id'' map.resources :team <---- THIS LINE ADDED BY ME Also have a team_controller.rb, a team.rb model and scaffolding for it. If I
2010 Dec 30
6
validates_inclusion_of doesn't match constant
Hello, I have a model Model: SPECIAL_FEATURES = %w(none top) class Model validates_inclusion_of :special_feature, :in => Model::SPECIAL_FEATURES, :on => :create, :message => "special_feature %s is not defined" belongs_to :team def special_feature attributes = attributes_before_type_cast if attributes["special_feature"]
2006 Jul 13
4
Regenerate DB
Hi again :), I''m playing with migrations. I''ve created some migrations classes and with rake db:migrate the tables are created and altered fine, but then I dropped some of the tables and when I run db:migrate command again I don''t get tables being re-created. What am I doing wrong? Is there a way to run db:migration in order to drop the tables? -- Posted via
2006 Aug 01
1
SimplyRestful
Hi, Is it SimplyRestful compatible with Rails 1.1.4 or Would I need edge Rails? -- Posted via http://www.ruby-forum.com/.
2006 Aug 11
2
Some questions of REST actions
I''ve set up my application to use edge rails in order to get REST functionality. I''ve a controller called team (team_controller.rb) with some actions (index, list, show, create, new....). Moreover in routes.rb I''ve added map.resources :team so I guess I could call localhost:3000/xxxx/team/1 or localhost:3000/xxxx/team/1;edit Well, when I do the first call, server
2008 Jul 24
1
How to add link_to_remote element with RJS?
Hello, after executing an action, I add an <li> element to an existing list using a RJS template: page.insert_html :bottom, :contributors, "<li id=''contributor.#{@contributor.id}''>#{@contributor.user.name}</li>" but I need to add an image with a link_to_remote as I have in a partial page: <li id="contributor.<%= contributor.id
2006 Nov 10
2
Testing with foreign keys
I''m looking for a plugin/whatever for preloading fixtures, to run tests with FKs defined. Specifying load order just doesn''t work for me, I need to purge the test db, load all fixtures, and only then create the FK constraints. Any suggestions? Isak --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2005 Dec 05
0
bug in bubbleshare's Active Record extensions?
I''m using add_foreign_key_constraint and remove_foreign_key_constraint from Bubbleshare''s Active Records Extension plugin now to manage the foreign key relationships I describe in my other recent posting. The constraints get added within migrations, but I''m running into two problems (Rails 0.14.3, PostgreSQL db): 1. Dumping the schema doesn''t dump the
2006 Mar 14
7
Starting with RJS - not working
Hi, I''m trying to work with RJS and folowed Cody Fauser''s tutorial (http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates) I''ve started by creating a new rails applications and executing rake freeze_edge rake rails:update:javascripts rake rails:update:scripts After that I''ve created a controller: class DtestController < ApplicationController
2008 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute? <div id="new_item_details" style="display:none"></div> <%= link_to_function("Show details...", nil, :id => "show_details") do |page| page.visual_effect(:toggle_blind, :new_item_details) if (page[:new_item_details].style.visibility ==
2006 Apr 27
3
Removing a default value for a foreign key with not null set
Hi all, For various reasons I need to have foreign keys with not null constraints. Eg: create_table :people do |t| t.column :name, :string t.column :household_id, :integer, :null => false end create_table :households do |t| t.column :name, :string end add_foreign_key_constraint :people, :household_id, :households, :id So the people table has a foreign key into
2006 Aug 13
10
does rails enforce referential integrity???
Hi, Is rails supposed to support referential integrity? That is rails either support to be able to ensure that when a new contact is created this can only happen if a valid suberb is associated with it, and which mechanisms of the below are supposed to do this? (a) using DB foreign key constraints information as a basis? (b) using the "has_one" line in the model file to enfore? If
2005 Jun 23
6
Problems with Hello World
Hello, I''m installed RubyOnRails in my Fedora Core 4 system. I''ve created an empty web application with: rails cookbook then a controller ruby script/generate controller MyTest And a file named my_test_controller.rb was created at cookbook/app/controller directory. I ''ve written a new method for MyTestController class like: def index render_text "Hello
2008 Jul 04
4
Libs directory
Hello, I had an application on Rails 1.2 or 1.1 (don''t remember). Now I have updated it to 2.1. I had a migrations_helper.rb in the Libs directory which defined foreign_key and drop_foreign_key methods. But now migrate task doesn''t find them. Have I to include this directory somewhere with Rails 2.1? Doesn''t it work as always? Could I use another thing to declare