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

all table names must be pluralized

Thank you!

Figured I was missing something obvious.

On Feb 7, 3:25 pm, Keynan P. [email protected]

Thank you!

Figured I was missing something obvious.

On Feb 7, 3:25 pm, Keynan P. [email protected]

your welcome

your welcome

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs