Skip to content

Instantly share code, notes, and snippets.

@ScullWM
Created March 3, 2012 18:03
Show Gist options
  • Save ScullWM/1967167 to your computer and use it in GitHub Desktop.
Save ScullWM/1967167 to your computer and use it in GitHub Desktop.
categorie:
tableName: categories
actAs:
Timestampable: ~
Sluggable:
unique: true
fields: [titre]
canUpdate: false
columns:
titre: { type: string(100), notnull: true }
description: { type: string(4000) }
position: { type: integer }
statut: { type: boolean, notnull: true, default: 1 }
dernier_msg: { type: timestamp, notnull: true }
subject:
tableName: subjects
actAs:
Timestampable: ~
Sluggable:
unique: true
fields: [titre, categorie_id]
canUpdate: false
columns:
categorie_id: { type: integer, notnull: true }
titre: { type: string(100), notnull: true }
message: { type: string(4000) }
relations:
categorie:
type: one
foreignType: many
local: categorie_id
foreign: id
onDelete: CASCADE
post:
tableName: posts
actAs: { Timestampable: ~ }
columns:
users_id: { type: integer, notnull: true }
subject_id: { type: integer, notnull: true }
message: { type: string(4000) }
relations:
subject:
type: one
foreignType: many
local: subject_id
foreign: id
onDelete: CASCADE
user:
type: one
foreignType: many
local: users_id
foreign: id
user:
tableName: users
columns:
login: { type: string(32) }
password: { type: string(32) }
email: { type: string(80) }
avatar: { type: string(150) }
statut: { type: boolean, notnull: true, default: 1 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment