Displaying 20 results from an estimated 3000 matches similar to: "migrations still"
2006 Jul 10
3
Problem with migrations
I am trying to start my first project after going though the Depot
application in prog prog''s book. For some reason one of my migrations keeps
bombing. I just try to setup a couple tables with some default information
and even with changing the name of the second table and other minor tweaks
it just does not work. I am connected to the db, the first table does get
filled out.
Any help
2006 Mar 31
2
A.R. Associations problem
Hello,
I''m learning A.R Associations by creating a simple forum that consists
of 3 tables: ahuthors, topics and posts. This is the schema:
class AddAuthorAndTopicAndPostTables < ActiveRecord::Migration
def self.up
create_table :authors do |t|
t.column :username, :string
t.column :email, :string
t.column :created_on, :datetime
end
create_table
2009 Nov 04
0
The error occurred while evaluating nil.prefetch_primary_key
The error occurred while evaluating nil.prefetch_primary_key?
Hi,
I have a problem with a model when I have 3 belongs_to relations in one
the middle.
This example is a subset of a grid-routing project:
n 1
1 n +------------ Project
Connection ------- ConnectionCost
+------------ WaySearchRun
2006 Jun 13
11
Question: Migration - multiple creates
I want to create a migration file that creates multiple tables, so i''m
guessing the correct format would be:
Can anyone confirm ? I''m guessing that each new create script requires a
seperate class so formatted this way. Perhaps I''m wrong.
TIA
Stuart
class CreateTable1 < ActiveRecord::Migration
def self.up
create_table :table1s do |t|
t.column :length,
2006 May 17
0
acts_as_versioned with lock_version bug?
Hello.
The acts_as_versioned plugin works fine ... till the adjunction
of optimistic locking via the lock_version table column.
Here is the problem description:
Without optimistic locking things are fine:
# ++++ The table creation migration ++++
% cat db/migrate/001_create_tables.rb
class CreateTables < ActiveRecord::Migration
def self.up
create_table :softwares,
2006 Aug 17
0
super-newb needs help with has_many and other things...
I am brand new to oop and am having a difficult time getting my head
around some ruby stuff. In specific, I am trying to create a library
style app that lists topics, articles and comments. I have a table
called topics, a table called articles and a table called comments. My
models, controller and view are all listed below. What I want to happen
is to have the list view list each topic along
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 Apr 07
4
How to generate mapping with migration
Hi there, I''ve tried to add a m:n mapping table using the migration
mechanism.
ruby script\generate migration add_categories_notes_mapping
and filled the migration file with:
class AddNotesCategoriesMapping < ActiveRecord::Migration
def self.up
create_table :categories_notes do |t|
t.column :category_id, :integer, :null=>false
t.column :note_id, :integer,
2010 Jun 29
3
belongs_to. Association methods don't pass data to DB
Hi.
I have a problem with the association methods which passed to a model
through a belongs_to declaration. Here''s an illustration of the issue:
GIVEN:
# migration
class CreateArticlesAndAuthorsTables < ActiveRecord::Migration
def self.up
create_table :articles do |t|
t.text :title
t.integer :author_id
end
create_table :authors do |t|
t.text
2006 Mar 15
3
Self-referential join model does not work
I have been trying to model a labeled graph using ActiveRecord (trunk
version). Basically, I have a ''Node'' model which represents a node linking
to other nodes. Links (aka edges) are labeled (i.e., have a ''label''
attribute and other behavior). Thus I decided to model edges as an ''Edge''
model and use a ''has_many :trough''
2006 Aug 08
0
Error is: Couldn''t find Producttype without an ID
I am at a lost for what is going on here-------I have a producttypes and
categories table. prodtype_id is a foreign key in categories table that
references producttypes table. Below is how I am tyying to display it
and get the above error. Any suggestion
</p>
<b>Product type:</b><br/>
<select name="Category[prodtype_id]">
<%
2006 May 02
0
Self-referential MtoM implementation
ok, guys i have followed the self referential recipe from the book it
works perfect but now i have some doubts, at the end the model are
modified to force the user beign added as a friend that add too who are
adding him so how i can make that the full relationship doesn?t be
complete until the friend beign added approves it(talking in the
implementation of the code of course)?
by the way,
2006 Aug 13
3
+ migrations in camping
Camping apps are supposed to be little independent apps, often contained in a
single file, which create the database tables and manage them without hassle.
These days it''s common to see in a Camping app:
module Tepee::Models
def self.schema(&block)
@@schema = block if block_given?
@@schema
end
end
Tepee::Models.schema do
create_table :tepee_pages,
2008 Feb 19
1
[CruiseControl] RubyOnRails build 8896 failed
The build failed.
CHANGES
-------
Revision 8896 committed by bitsweat on 2008-02-19 02:56:05
Don''t assume all records from nested include are of same class. Closes #11154 [acechase]
M /trunk/activerecord/lib/active_record/association_preload.rb
A /trunk/activerecord/test/cases/associations/eager_load_nested_include_test.rb
TEST FAILURES AND ERRORS
-----------------------
Name:
2012 Feb 14
4
What I'm doing wrong, has_and_belong_to_many
Hello, I''m trying to insert into my migrate but when I try on rails
console this error shows:
1.9.3-p0 :001 > group = Group.new
=> #<Group id: nil, name: nil, description: nil, created_at: nil,
updated_at: nil>
1.9.3-p0 :002 > group.name = "Group Name"
=> "Group Name"
1.9.3-p0 :003 > group.description = "Description"
=>
2007 Oct 22
1
self-referential habtm: why are my keys null?
I''m trying to set up a directional self-referential HABTM to represent
an arbitrary semi-hierarchical structure; it works for any data
prepopulated into the db, but when I try to create a new relationship,
I just get NULLs in both key columns (or 0''s if I turn on the no-null
constraint).
Here are the migrations:
class CreateNodes < ActiveRecord::Migration
def self.up
2006 Jan 21
5
Help...why ''rake migrate'' can''t be executed on RadRails
''rake migrate'' command can''t be executed on RadRails?
I found Terminal Window at RadRails and executed ''rake migrate'' on that
terminal
many times.but nothing happend,even error messages.
I made InitialSchema file like these and configured database.yml.
of course I made database before executing ''rake migrate''
anyone,get me
2007 Apr 15
1
help:How to set default value for a column use of migration?
hi,all..
Here i want to use of migration to create a table and set a defult
value for a column..but i cant''t finished..
mycode:
class CreateMessages < ActiveRecord::Migration
def self.up
create_table :messages do |t|
t.column :name, :string
t.column :content, :text
t.column :posttime, :datetime, :default => "now()"
end
end
def
2006 Aug 08
2
Problem with plurals, migrations?
Hi,
Ruby 1.8.4
Rails 1.1.4
Windows XP Pro
I''m hitting an issue with migrations that I suspect relates to
pluralization. Here''s the migration:
class Hardware < ActiveRecord::Migration
def self.up
create_table :hardware do |h|
h.column :vendor, :string, :limit => 32
h.column :model, :string, :limit => 32
end
2006 Jan 12
1
Best Forum? Was: Migration doesn''t seem to preserve create_table options in schema
Hi,
is this the best forum to answer this question? Is there any better source
for information or another mailinglist to address this question to?
Cheers,
Mariano
---------- Forwarded message ----------
From: Mariano Kamp <mariano.kamp@gmail.com>
Date: Jan 8, 2006 6:24 PM
Subject: Migration doesn''t seem to preserve create_table options in schema
To: rails@lists.rubyonrails.org