Displaying 3 results from an estimated 3 matches for "categories_id_seq".
2008 Nov 14
3
migration with data
...d::Migration
def self.up
create_table :categories do |t|
t.column :name, :string, :limit=>80
end
end
def self.down
drop_table :categories
end
end
and 002_populate_categories.rb
class PopulateCategories < ActiveRecord::Migration
execute ''ALTER SEQUENCE categories_id_seq RESTART WITH 100;''
NAMES = ["Category 1", "Category 2", "Category 3"]
def self.up
NAMES.each{|name| Category.create(:name => name)}
end
def self.down
NAMES.each{|name| Category.find_by_name(name).destroy}
end
end
My problem...
2006 Jul 14
3
postgres migration notices
When I run "rake" using a postgres 8.1 database, I get a bunch of these notices.
NOTICE: CREATE TABLE will create implicit sequence
"categories_id_seq" for serial column "categories.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
"categories_pkey" for table "categories"
How can I avoid those? I take it I need to modify the migrations.
Thanks,
Joe
2008 May 19
2
x is not a number error??
...abase constraints are:
Table "public.categories"
Column | Type |
Modifiers
-------------------+---------
+--------------------------------------------------------------------------
id | integer | not null default
nextval(''categories_id_seq''::regclass)
parent_categoryid | integer |
...
Indexes:
"categories_parent_categoryid" btree (parent_categoryid)
Foreign-key constraints:
"$1" FOREIGN KEY (parent_categoryid) REFERENCES categories(id) ON
DELETE CASCADE
Thanks for any help you can offer.
Matt...