Displaying 20 results from an estimated 3000 matches similar to: "Migration fails when using certain table name"
2006 Feb 15
2
migrations still
I think I am pissing into the wind to make migrations work at this
point.
Looking at
http://wiki.rubyonrails.org/rails/pages/UnderstandingMigrations
it appears that the problem that I am having is that postgresql can''t do
the drop_table part because of the foreign_key keys (constraints) which
requires ''cascade'' as an option to drop some of the tables that have
other
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 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
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 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 Mar 28
1
simple output string
Hi!
I am new to Rails and wanted to know how I can print an easy
string-line.
I wanted to generate a dynamic title for my blog articles made with
"typo":
The first part of the html-title stays the same:
<title>softrockcookie</title>
if it is not the mainpage ("softrockcookie") it shall add the
page_title, so:
<title>softrockcookie <%= page_title
2006 Aug 18
1
Migration crashes when using braces to delimit blocks
Hi,
I have been using a bit of ruby here and there for scripting jobs for a year
or so, and more recently have started dabbling in rails. I was wondering if
anyone can help me with a strange behaviour I am getting when trying to run a
migration. If I delimit a block for the create_table method with braces, the
migration crashes, whereas the exact same code with the braces replaced by
2006 Sep 05
0
rake craziness with Migrate as a dependency
Hi everyone,
For one of our projects we have a need to deploy and maintain a demo.
As a result I''ve attempted to setup a set of rake tasks for the job.
My goal is have one rake task called "deploy_demo" which purges the
database, migrates to the current schema, and loads the db from a set
of fixture files in a specified location.
I''ve written two new tasks the perform
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 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 Jan 08
0
Migration doesn''t seem to preserve create_table options in schema
Hi,
I have the following migration (abbreviated):
class Initial < ActiveRecord::Migration
def self.up
create_table :messages, :options => ''ENGINE=MyISAM'', :force => true do
|t|
t.column :id, :integer, :null => false
t.column :external_id, :string, :null => false
t.column :recipients_count, :integer, :default => 0
2008 Jun 02
1
Looking for help on two issues with Rails 2.1 and RSpec 1.14
I have specs that ran fine in Rails 2.02/RSpec 1.13 that are failing on
Rails 2.1/RSpec 1.14.
There is one problem and one issue:
problem: sometimes (but not always) I get a NoMethodError referencing a
has_many association
issue: in helper specs, instance variables don''t get set unless the
HelperModule is included. Using the preferred helper.<method> I can''t seem
to
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"
=>
2006 Mar 23
5
Custom date format
Hi, I''ve followed these directions :
http://railswiki.pdxruby.org/HowToDefineYourOwnDateFormat.html
It seems pretty straightforward but obviously it doesn''t work for me...
article.date_edited.to_formatted_s(:my_format_1)
produce a default formatted date, not the one I''ve defined in
environment.rb :
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(
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 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,
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