Displaying 20 results from an estimated 20000 matches similar to: "newbie - Problem running unit test because of text column"
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 Jun 21
3
rake migrate says table already exists
Hi all,
I used the generate script to make a bunch of table migrations,
resulting in files like 002_bookmarks.rb, 003_tags.rb, etc. When I
did the ''rake migrate'', the db was set up but more migration files
appeared, now called 009_create_bookmarks.rb, 010_create_tags.rb,
etc. Now when I want to change the database (add a table or column,
alter the schema) I do
2009 Aug 31
3
Migration - wrong SQL statement is created
Hi,
I am doing my first steps with RoR and I have the following problem:
I execute my migration file with the following content on a
MySQL-database via Rake:
<code>
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.integer :id
t.string :username, :size => 100
t.string :password, :size => 100
t.string :email, :size
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
2006 Feb 23
0
Problem with db_schema_import and MySQL timestamp!
Hi,
This post concerns a SQL error while I try to import a schema into MySQL
with timestamp dates.
To reproduce try these commands:
mickey@bunny:~/dev/rails/timeonrails$ rake db_schema_dump
(in /home/mickey/dev/rails/timeonrails)
mickey@bunny:~/dev/rails/timeonrails$ cat db/schema.rb
# This file is autogenerated. Instead of editing this file, please use the
# migrations feature of ActiveRecord
2006 Mar 21
3
Newbie - ActiveRecord relationships
So I''ve worked through Agile Web Development with Rails and I''m now
trying my first little app to get into the swing of things. Its a task
tracking app where people can create tasks and assign them to others,
and also log time against the tasks.
I''m having trouble working out the model relationships. This is what
I''ve got so far, but its not right as
2006 May 30
3
Help about CMS - newbie in RoR
Hi team, I''m a very newbie RoR user from Spain and I''m developing a
blog''s CMS. Why RoR?, coz I think it''s an amazing framework with many
posibilities, portable and really powerful, with a young and optimist
community, and taking my project I''ve prefered his structure in front of
LAMP. Another thing is that I''ve liked to surprise my masters
2006 Apr 22
7
Proper Database Design For A Newbie
Hi all,
I am starting out learning Ruby on Rails (coming from a PHP background)
and I have a question about proper database design.
Let me give you a quick example of what I want to do:
Database:
CREATE TABLE `users` (
`id` int(11) NOT NULL auto_increment,
`login` varchar(40) default NULL,
`email` varchar(100) default NULL,
`crypted_password` varchar(40) default NULL,
`salt`
2008 Apr 30
4
Beginner mysql problem
I am new to rails and have come across a problem with a sample
application I was working on.
When trying to use rake migrate I got the error listed below.
my db file contains the following
class ContactDb < ActiveRecord::Migration
def self.up
create_table "people" do |t|
t.column "id", :integer
t.column "name",
2006 Jul 15
1
Relationship problem, newbie problem, need help!!
Hey all
I seem to be having some problems with my relationship between a few
tables...
If i then run the following query in mysql, i get the data i want. How
do i do this in rails relationships and models?
select * from shop_addresses
left join shops on shops.id = shop_addresses.shop_id
left join styles on styles.id = shops.style_id
where shop_uri = ''127.0.0.1''
Cheers!!
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
2009 Jul 04
3
scaffolding
hi , i used the folllwing command to scaffold,
G:\my\webblog>ruby script/generate scaffold webblog id:integer
title:string body
:text created_at:datetime
after when i migrate with the follwing command
rake db:migrate
i got the error as
(in G:/my/webblog)
== 1 CreateWebblogs: migrating
================================================
-- create_table(:webblogs)
rake aborted!
Mysql::Error:
2006 Jan 26
9
Problem with schema_db_import on Site5?
Hello,
I am trying to put my rails app on a host .So I presume the method to do
this is to first do
rake db_schema_dump and then copy it to the host and do
rake db_schema_import.
I use mySQL Ver 14.7 Distrib 4.1.14, for pc-linux-gnu (i686) using readline
4.3
** Invoke db_schema_import (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db_schema_import
rake
2006 Sep 29
1
newbie Q: it won't display foreign keys...
I have two tables
CREATE TABLE continents (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE countries (
id int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL,
continent_id int(11) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I generate scaffolds for country and for
2006 Mar 01
1
maddening intermittent failures in unit tests with "working" code
Hi all,
This testing problem has been a sink for time today, and is still unresolved.
Basically I have some unit tests that test simple functions (example below)
that depend on join operations in a habtm relationship, and I suspect I am
getting "false" failures, i.e ones that do not logically make any sense. I
need fresh sets of eyes to take a look and see if I''m mising
2010 May 28
3
Beginner Facing Problem with rake db:migrate
I am beginner for this Rails from the past 2 days I am working hard
to fix the following error
C:\Murali Rubby\demo\library>rake db:migrate --trace
(in C:/Murali Rubby/demo/library)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
== CreateBooks: migrating
====================================================
--
2006 Aug 02
2
many-to-one relationship, do I need a second table?
Ok, to keep things short. Im wondering if I need a secondary
relationship table to handle my many-to-one relationships. Here is an
example of what I''ve written down. For instance say I want to find all
of the people in a given location.
class Location < AR:Base
has_many :people
end
class Person < AR:Base
belongs_to :location
end
My SQL tables look like:
CREATE TABLE
2006 Aug 14
1
rake test:units -> table already exists
Hi!
When I run test:units, rails complains about the tables already being
present. They had to be present so I could run individual unit tests. So
why doesn''t rails just drop the tables if they exist?
Any ideas??
Jeroen
debug oupt below:
>rake test:units --trace
(in ...)
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
2006 May 10
3
migrations :timestamp becomes :datetime in mySql
For some reason whenever I try and create a timestamp column with
migrations and mysql I get a datetime column instead. That''s kind of
annoying because I want the column to update every time the row gets
changed. Is this a bug, or is there something I can do about it?
(Obviously I can manually change my mysql table, but that kind of
defeats the point of migrations!)
In my migration
2006 Jan 25
1
Rails day 2: where is my association?
I?m following along a few tutorials on the web and trying to implement
my own example, but I must be missing something because I can?t get
has_many or belongs_to to work like I expected. now I have watched all
the videos and made a cookbook several times with different interfaces.
what I''m looking for is *not* a code snippet to solve something (because
I already have that),