Displaying 1 result from an estimated 1 matches for "sect_nam".
Did you mean:
sect_name
2006 May 18
8
Concatenated key
...concatenated primary key.
I want to use my own names for the DB fields and I''m using SQL Server
2005.
My tables look roughly like this:
CREATE TABLE USERS (
USR_ID VARCHAR(25) NOT NULL PRIMARY KEY,
USR_PASS VARCHAR(25)
)
CREATE TABLE SECTOR (
SECT_ID TINYINT NOT NULL PRIMARY KEY,
SECT_NAME VARCHAR(25)
)
CREATE TABLE PERMISSION (
FK_USR_ID VARCHAR(25) NOT NULL,
FK_SECT_ID TINYINT NOT NULL
)
ALTER TABLE PERMISSION
ADD CONSTRAINT PK_PERMISSION
PRIMARY KEY (FK_USR_ID,FK_SECT_ID)
And my models look like this:
class User < ActiveRecord::Base
set_primary_key "USR_ID"
d...