Displaying 20 results from an estimated 500 matches similar to: "Migration Bug?"
2011 Aug 07
2
PROBLEM WITH PAPERCLIP
hello,
i am trying to upload a image file ...using paperclip in rails 3
i did as follows
1. In gemfile => included gem paperclip
2.In config/environments /development.rb => Paperclip.options[:command_path]
= "/usr/bin/" (convert path)
3.created a controller *picusers *and defined => def create
@picuser = Picuser.create(params[:picuser])
end
4.created a model *picuser
2008 Apr 30
12
Strange memory issue
Like most, I have a test and a production env. Both are CentOS 5, Ruby
1.8.6, Rails 2.0.2, MySQL 5, and Apache. Both were setup using the
same procedure. Except for the hardware (test: Intel, prod: AMD) and
memory (test: 512M, prod: 1G), both systems are essentially the same
right down to the Rails env. Unfortunately, memory usage is very
different for each.
The test system has 2 mongrel
2009 Sep 03
12
paperclip is not saving the files
Hi all,
I''ve installed paperclips but
paperclip is not saving the files
my model has
has_attached_file :attachment,:styles => { :medium => "300x300>",
:thumb => "100x100>" }
and i have db migration as
class AddAttachmentToPolicies < ActiveRecord::Migration
def self.up
add_column :policies,
2006 Nov 29
2
db:migrate to add colum bombs...
Hi
I get the following when I try and run "rake db:migrate" (I"m running un
Ubuntu linux)
********** code **********
(in /<home hidden>)
== AddRpts: migrating
=========================================================
-- add_column("rpts", :integer, {:limit=>3})
rake aborted!
You have a nil object when you didn''t expect it!
You might have expected an
2010 Feb 25
2
[PATCH] Enhance vms display
It can be quite hard to manage a pool of 40-50 VMs without informations about the OS running, the contact (which is the only one to know when the vm can really be destroyed) or an End Of Life date. This patch add those fields, and rework a little the VM list view, in order to show gracefully those new fields. It has been made at the expense of UUID, Total Run Time & Load fields. Since those
2006 Apr 02
5
adding primary_key to join table using migrations
Hi list,
My tag_question_user join table is not currently a full-blown model. It
doesn''t have a primary key - just tag_id, question_id, and user_id.
I now want to add a primary key to this model (because I want to add a
"description" column as well so users can describe the tag.
I''m not sure how to add this using migrations.
Here is what I have:
class AddNotesToTags
2008 Feb 13
4
Migration Issues: Can't update newly added column values
Hello everyone, just wondering if anyone can help me with a migrations
question here.
Using:
rails 2.0.2
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin]
mysql 5.0.45
Platform:
windows xp
The problem:
----------
I created a migration that is designed to add a column named
"deleted_at" (timestamp) and then remove a column named
"is_deleted" (boolean). The idea is to
2006 Aug 02
2
Help please: AWDWR -- Migration failure
I''m having a problem with one of the migration files from the depot application.
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== AddPrice: migrating ========================================================
-- add_column(:products, :price, :decimal, {:scale=>2, :default=>0, :precision=>
8})
rake aborted!
You
2006 May 26
7
migration with required data
I''m working on a bugtracker application in rails. I have a Bug model
and I want to add a Priority to the mix. A Bug can have one priority.
I generate a Priority model, modify my Bug model with a belongs_to
:priority and create my migration like so:
class CreatePriorities < ActiveRecord::Migration
def self.up
create_table :priorities do |t|
t.column :name, :string,
2007 Oct 18
9
with_scope issue
I have the following code:
class User < ActiveRecord::Base
has_many :requests do
def find_active(options = {})
with_scope :find => { :conditions => ["requests.active = ?",
true] } do
find(:all, options)
end
end
end
end
Executing user.requests.find_active results in the following SQL:
SELECT * FROM requests WHERE (( requests.user_id = 10 ) AND
(
2006 Jan 14
11
accessing models from migrations
Ok, so now Users need to be associated with Organizations. I''ve
created a migration and added a ''organization_id'' column to the users
table. I want the default organization_id to be the first
Organization. So I have :default => Organization.find(:first). But
it''s complaining about not being able to find the constant
''Organization''.
Any
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 May 16
5
rake aborted when adding a column
I''m having a silly little problem with migrations. All I''m
trying to do is to add an SSN column to my Employees table. I
generated a migration which looks like:
class AddSsn <
ActiveRecord::Migration
def self.up
add_column :employees,
:ssn,
:string
end
def self.down
remove_column :employees,
:ssn
end
end
When I run this, however, I get:
>rake
2006 Aug 04
8
Demo in rails2.pdf of add_price migration, PostgreSQL 8.1.4
People,
I''m looking at the migrate example on p 74 of the rails2.pdf
It''s a simple example of using a migration to add a column to
the products table.
Here is a copy of the migration file named 002_add_price.rb
after I generated and then edited it:
class AddPrice < ActiveRecord::Migration
def self.up
add_column :products, :price, :decimal, :precision => 8, :scale
2006 Jul 18
3
DB Migrations & Column Order
Hello,
I created a table and about 10 migrations down the line I decided that
I needed to add an ID column (this was actually a table for a has_many
:through and I recently realized that it needs an ID column, unlike
HABTM tables). I am a big perfectionist and I frequently run "SHOW
COLUMNS IN table;", so I naturally expect to see the "id" column the
first one listed. However,
2010 Aug 25
2
[PATCH] Virtio support
From: Simon Courtois <scourtois at linagora.com>
Signed-off-by: Simon Courtois <scourtois at linagora.com>
---
src/app/controllers/vm_controller.rb | 19 ++++++++++++++++-
src/app/views/vm/_form.rhtml | 25 ++++++++++++++++++++---
src/db/migrate/044_add_virtio_to_vm_and_nic.rb | 11 ++++++++++
src/public/stylesheets/components.css | 5
2010 Sep 21
1
[PATCH] Introduce ability to select any kind of nic model, not just default or virtio.
There was no release since virtio support was introduced, so a proper
migration is not necessary.
Signed-off-by: Nicolas Ochem <nicolas.ochem at gmail.com>
---
src/app/controllers/vm_controller.rb | 6 ++-
src/app/models/nic.rb | 2 +
src/app/views/vm/_form.rhtml | 25 +++++++++-------
src/db/migrate/046_add_model_to_nic.rb | 29 ++++++++++++++++++
2011 Apr 01
4
add_column not working in migration for sqlite3
Hello,
I developed an app with postgres DB but want to change the DB to
sqlite3. I changed the database adapter in the database.yml file. When I
run the migration most of it was successful but add_column was throwing
an error
"Cannot add a NOT NULL column with default value NULL: ALTER TABLE
"rates" ADD "customer_id" integer NOT NULL".
I made the modification and
2006 Aug 09
1
Migrating a Field to External Model
I have a model Product with an attribute ''brand''. Currently it is a
simple attribute, however, I am migrating it to a separate model
Brand so that I can have other attributes with each brand. I created
the the model and created and ran the migration to create the new
table. So far so good. Then I created a separate migration to
transfer the data. The up method
2006 Jun 15
6
Newbie''s problem with a nil object he didn''t expect!
Dear Rubyists/Rails gurus,
Though I''ve successfully completed the various Rails tutorials online
and the Depot application from the Agile Web Development with Rails
book, I''m still pretty much a Ruby/Rails newbie. I''m trying to learn by
writing my own simple blogging application, but I''ve run into a problem
that has had me scratching my head for a few days now.