Displaying 20 results from an estimated 50000 matches similar to: "How to install the Foreign Key Schema Dumper Plugin"
2006 Jul 10
1
Migration and foreign keys
Hi,
I''m using the ''rake db_schema_dump'' command to clone the structure of
the developement database into the test database.
Unfortunatelly, the schema.rb file doesn''t contain any information about
the foreign keys of the tables. For this reason all the test that
concern about the relations are not working has suposed.
Is this a limitation of Rails or am I
2006 Apr 11
2
Schema.rb and MySQL decimal
Hi,
I have a mysql schema with some decimal(20,20) fields. Now, I made a
rake db_schema_dump for deployment of my applications on other machines.
Rails created a schema.rb with the decimal fields as float.
After a rake db_schema_import the fields are just float not decimal. How
can I force rails to create decimal(20,20) columns instead of float?
Thx.
Marc
--
Posted via
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,
2006 Feb 17
1
foreign key support in mysql adapter
Hi!
I''m using Migration to define my database schema and these "ALTER TABLE
t ADD FOREIGN KEY..." look really ugly - that''s why I wanted to ask it
would be possible to simply add add_foreign_key method to ActiveRecord?
Are there any reasons this isn''t yet implemented?
Greetings,
Esad
--
Posted via http://www.ruby-forum.com/.
2006 Apr 04
0
schema.rb: foreign keys and reference data
Is there any way to add:
1) Foreign keys, and
2) Reference data
to db/schema.rb? I''ve browsed the docs and couldn''t find a way to do either of
those tasks.
2006 Jan 18
3
Support for foreign keys in Migrations
Is there any work being done to add support for defining foreign keys in
ActiveRecord Migrations? If not is it something that people would find
useful or do most people here believe in the "Application Database" style
over the "Integration Database" style [1] as defined by Fowler?
I''d love to see support for foreign keys in Migrations. For selfish reasons
2005 Dec 22
2
help me understand migrations movie
I''m somewhat of a newbie - played with recent versions of rails a few
mths ago, but have decided to start from scratch with 1.0.
I want to build my new db as much as possible with migrations, so I
watched DHH''s migrations movie from rubyonrails.org.
A few things confuse me:
1. He generates the model ("post") before running rake db_schema_dump.
Is that necessary or
2006 Feb 25
1
Migrations for initial schema: Where to put initial data?
Hi, I''m trying to get my head around using migrations to define my
initial schema.
When using migrations, I want to:
- Avoid creating a new migration for every small change. Limit it to one
migration per checkin.
- When creating a new (fresh) schema, I do not want to go through the
overhead of all the migrations.
These are the steps I came up with, to create the initial schema:
1.
2006 Feb 25
0
Dumper, mySQL adapter and TIMESTAMP ... something strange ?
Hi,
As explained by MiKael Navarro in the following post
(http://www.ruby-forum.com/topic/55662#new) it seems that there''s a
problem with the way the mySQL adapter treats the TIMESTAMP column.
Actually, when an SQL schema with for example:
created_on TIMESTAMP
is dumped into ruby schema, it will lead to:
t.column "created_on", :timestamp, :limit => 14
but if we
2005 May 24
2
Deleting from a 'has_many' collection doesn't set the foreign key to NULL
Hi all,
I have an Active Record problem. Having this classes declaration.
class Sale < ActiveRecord::Base
has_many :sale_line_items, :class_name ''SaleLineItem''
...
end
class SaleLineItem < ActiveRecord::Base
...
end
When I try to delete an item in a Sale class method from sale_line_items
(sale_line_items.delete(li)), it extracts ''li'' from
2006 Jan 03
4
Set the foreign key constraint column name?
I am applying Rails to an existing schema and not sure how much the
existing developers will let me go in and rename things. So I need to
discover the limits of what I can change with Rails.
I''ve found set_table_name and set_primary_key, which have been very
useful.
If I have a "foo has_one :bar" relationship, but then in the bar table
my column is named "fooid"
2006 Jul 13
1
model navigation problem with foreign key
Hi,
I have a table like this in schema.rb
create_table "ac_rooms", :force => true do |t|
t.column "roomname", :string, :limit => 50, :default => "", :null =>
false
t.column "updated", :float, :default => 0.0, :null => false
t.column "lines", :integer, :limit => 8, :default => 0, :null =>
false
2006 Feb 07
0
newbie -- displaying foreign key
Hi ..
A conceptual question this time.
I have the relation:
member (m)---(1) member_type
The schema looks something like this (simplified + PGSQL)
create table member_types (
id serial,
info varchar( 20 ) not null,
primary key( id )
);
create table members (
id serial,
first_name varchar( 100 ) not null,
2006 Apr 07
6
Foreign Key naming convention override
I am working with an existing database and have to keep all table and
field names as they are. ''tblcustomers'' and ''tblitems'' are linked by the
''tblcustomers'' id field ''tblcustomersid''. In ''tblitems'', the foreign key
is called ''txtcustomerid''.
I have already set the customers model to
2011 Jun 11
1
Having a problem adding a foreign key
I keep getting this exception "SQLite3::SQLException: no such
column: books.user_id: SELECT "books".* FROM "books" WHERE
("books".user_id = 4)" ,which sounds like there is no user_id in books
table.So i just installed foreigner plugin and added "
t.integer :user_id, :null => false" and
"add_foreign_key(:books, :users)" in book
2006 Apr 26
1
rake db_schema_dump make syntax error
rake migrate bug with datetime:
> rake db_schema_dump
produced a bad schema.rb that isn''t valid ruby, it has an invalid default, unless ruby
takes bare words:
t.column "date_available", :datetime, :default => Sun Jan 01 00:00:00 Arabic Standard
Time 2006, :null => false
I don''t think the Baghdad time zone should matter.
ruby 1.8.4, rails 1.1.2,
2008 Mar 21
5
foreign key question
Hi-
Say I have a db with following schema:
MyTable:
Id, name, user_id, date
User:
id, name, description
I know that I want to add "belongs_to" in my "user" model but how can
I enforce a proper constraint on the user_id in "MyTable"? Is this
done using a has_one in the "MyTable" model?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
You
2006 Aug 07
2
schema -> migrations
I''ve poked around a bit with Google and I can''t find a way to generate a
base set of migrations from a given SQL schema. Is there an easy way to
do this?
thanks
John
2008 Feb 28
1
rake aborted! Don't know how to build task 'db_schema_dump'
Oh noes! What do I do?
Just installed RoR and SQLite3 yesterday, watched a screencast that said
the db_schema_dump will slaughter my enemies and make my poop smell like
rainbows. Now I get rake telling me that it doesn''t know how to. Any
help?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are
2008 Oct 08
5
schema.dump chokes on RAW type
I haven''t seen anyone mention this yet.
The tail end of the migration process is a call to schema.dump. Our
primary keys are uuids and these choke schema.dump on both oracle and
postgres. The latter fails silently (skips three tables) while the
former complains about the RAW(16) in each of the three tables.
Anyone had a similar experience?
--
Posted via http://www.ruby-forum.com/.