DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-07 22:06 UTC
Problems Generating Scaffolding
I am having trouble generating some of my scaffolding. I''m trying to use PostgreSQL as my back-end. Some of my scaffolding generates with no problem but for other parts I get this: Before updating scaffolding from new DB schema, try creating a table for your model The tables do exist. At least I can see them from psql. Here is the SQL I''m using to create my tables: CREATE TABLE dept ( name character varying(20) NOT NULL, CONSTRAINT dept_pkey PRIMARY KEY (name) ) WITHOUT OIDS; CREATE TABLE computer_role ( model character varying(15) NOT NULL, os character varying(10) NOT NULL, role integer NOT NULL, CONSTRAINT computer_role_pkey PRIMARY KEY (model, os, role) ) WITHOUT OIDS; CREATE TABLE computers ( ram integer NOT NULL, model character varying(15) NOT NULL, cpu integer NOT NULL, cores integer NOT NULL DEFAULT 1, disk integer NOT NULL, -- Space in Gigabytes census integer NOT NULL, CONSTRAINT computers_pkey PRIMARY KEY (model, ram, disk) ) WITHOUT OIDS; COMMENT ON COLUMN computers.disk IS ''Space in Gigabytes''; CREATE TABLE technicians ( name character varying(40) NOT NULL, phone character(4) NOT NULL, department character varying(20) NOT NULL, email character varying(30) NOT NULL, CONSTRAINT technician_pkey PRIMARY KEY (email) ) WITHOUT OIDS; CREATE TABLE sites ( room character varying(8) NOT NULL, num_machines integer NOT NULL, dept character varying(20) NOT NULL, software character varying(25)[] NOT NULL, machine_types integer[] NOT NULL, machine_type character varying(20)[] NOT NULL, CONSTRAINT sites_pkey PRIMARY KEY (room), CONSTRAINT sites_dept_fkey FOREIGN KEY (dept) REFERENCES dept (name) MATCH SIMPLE ON UPDATE RESTRICT ON DELETE NO ACTION ) WITHOUT OIDS; CREATE TABLE free ( name character varying(15) NOT NULL, publisher character varying(15), version character varying(8) NOT NULL, num_copies integer NOT NULL, depts character varying(15)[] NOT NULL, CONSTRAINT free_pkey PRIMARY KEY (name, version) ) WITHOUT OIDS; CREATE TABLE licensed ( name character varying(30) NOT NULL, version character varying(10) NOT NULL, publisher character varying(15) NOT NULL, serial character varying(25) NOT NULL, lm boolean NOT NULL, license_file text, licenses integer NOT NULL, num_disks smallint NOT NULL DEFAULT 1, CONSTRAINT licensed_pkey PRIMARY KEY (name, version, publisher) ) WITHOUT OIDS; I have no trouble with the scaffolding for sites, computers, and technicians but it throws up on the others. Please forgive me if this is obvious. This is my first time trying to use rails. Any help would be greatly appreciated. Thanks, Glen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
all table names must be pluralized -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-07 22:28 UTC
Re: Problems Generating Scaffolding
Thank you! Figured I was missing something obvious. On Feb 7, 3:25 pm, Keynan Pratt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> all table names must be pluralized > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
DamnBigMan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-07 22:28 UTC
Re: Problems Generating Scaffolding
Thank you! Figured I was missing something obvious. On Feb 7, 3:25 pm, Keynan Pratt <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> all table names must be pluralized > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
your welcome -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
your welcome -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---