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: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Glen, This list is for discussion of the development of Rails itself. Please see ruby on rails talk: http://groups.google.com/group/rubyonrails-talk?lnk=srg&hl=en On 2/7/07, DamnBigMan@gmail.com <DamnBigMan@gmail.com> wrote:> > 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 > > > > >-- Kevin Clark http://glu.ttono.us --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
My apologies. I should read more. I was directed here and didn''t think twice about it. On 2/7/07, Kevin Clark <kevin.clark@gmail.com> wrote:> > > Glen, > This list is for discussion of the development of Rails itself. Please > see ruby on rails talk: > http://groups.google.com/group/rubyonrails-talk?lnk=srg&hl=en > > On 2/7/07, DamnBigMan@gmail.com <DamnBigMan@gmail.com> wrote: > > > > 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 > > > > > > > > > > > > -- > Kevin Clark > http://glu.ttono.us > > > >-- "Hey brother christian with your high and mighty errand, Your actions speak so loud, I can''t hear a word you''re saying." -Greg Graffin (Bad Religion) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---