Skip to content

Instantly share code, notes, and snippets.

@dmclark
Created March 8, 2011 19:24
Show Gist options
  • Save dmclark/860833 to your computer and use it in GitHub Desktop.
Save dmclark/860833 to your computer and use it in GitHub Desktop.
Center:
tableName: center
actAs: [ Versionable, Timestampable ]
columns:
name: { type: string(255), notnull: true, unique: true }
address1: string(30)
address2: string(30)
city: string(30)
state: string(2)
zip: string(12)
type_id: { type: integer, notnull: true, default: 1 }
notes: clob
Client:
tableName: client
actAs: [ Versionable, Timestampable, SoftDelete ]
columns:
center_id: { type: integer, notnull: true }
fname: { type: string(25), notnull: true }
lname: { type: string(25), notnull: true }
guardianFname: { type: string(25), notnull: true }
guardianLname: { type: string(25), notnull: true }
address1: string(30)
address2: string(30)
city: string(30)
state: string(2)
zip: string(12)
dob: { type: date, notnull: true }
is_active: { type: boolean, notnull: true, default: true }
edited_by: { type: integer, notnull: true }
relations:
Center: { local: center_id, foreign: id, foreignAlias: Client }
Staff: { onDelete: CASCADE, local: edited_by, foreign: id, foreignAlias: Client }
Staff:
tableName: staff
actAs: [ Versionable, Timestampable, SoftDelete ]
columns:
center_id: { type: integer, notnull: true }
sf_guard_user_id: { type: integer }
role: { type: integer, notnull: true }
address1: string(30)
address2: string(30)
city: string(30)
state: string(2)
zip: string(12)
startDate: { type: date, notnull: true }
endDate: { type: date }
is_active: { type: boolean, notnull: true, default: true }
relations:
Center: { onDelete: CASCADE, local: center_id, foreign: id, foreignAlias: Staff }
sfGuardUser: { type: one, foreignType: one, onDelete: CASCADE, foreignAlias: Staff }
Instrument:
columns:
name: { type: string(255), notnull: true, unique: true }
description: clob
relations:
Ouestions:
class: Question
foreignAlias: Instruments
refClass: InstrumentQuestion
local: instrument_id
foreign: question_id
Question:
columns:
name: string(255)
type_id: integer
InstrumentQuestion:
columns:
instrument_id: { type: integer, primary: true, notnull: true }
question_id: { type: integer, primary: true, notnull: true }
item_number: { type: integer, notnull: true }
relations:
Instrument:
local: instrument_id
foreign: id
foreignAlias: Questions
Question:
local: question_id
foreign: id
foreignAlias: Questions
Test:
actAs: [ Timestampable ]
columns:
client_id: { type: integer, notnull: true }
staff_id: { type: integer, notnull: true }
instrument_id: { type: integer, notnull: true }
relations:
Instrument: { local: instrument_id, foreign: id, type: one, foreignType: many, foreignAlias: Tests }
Staff: { local: staff_id, foreign: id, type: one, foreignType: many, foreignAlias: Tests }
Client: { local: client_id, foreign: id, type: one, foreignType: many, foreignAlias: Tests }
Answer:
columns:
test_id: { type: integer, primary: true, notnull: true }
question_id: { type: integer, primary: true, notnull: true }
response: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment