1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| ##################################### User #####################################
Membre:
inheritance:
extends: sfGuardUser
type: simple
columns:
date_naissance: date
lieu: string(45)
bio: string()
relations:
Conversations:
class: ConversationPrivee
local: user_id
foreign: conversation_id
refClass: MembreConversationPrivee
type: many
News:
type: many
local: id
foreign: user_id
CommentairesNews:
class: CommentaireNews
type: many
local: id
foreign: user_id
################################## Messagerie ##################################
ConversationPrivee:
columns:
id:
type: integer
unsigned: true
primary: true
autoincrement: true
sujet:
type: string(45)
notnull: true
relations:
Participants:
class: Membre
local: conversation_id
foreign: user_id
refClass: MembreConversationPrivee
type: many
Messages:
class: MessagePrive
local: id
foreign: conversation_id
type: many
MembreConversationPrivee:
tableName: participant
columns:
user_id: { type: integer, primary: true }
conversation_id: { type: integer, unsigned: true, primary: true }
MessagePrive:
actAs:
Timestampable: ~
columns:
id:
type: integer
unsigned: true
primary: true
autoincrement: true
user_id:
type: integer
conversation_id:
type: integer
unsigned: true
notnull: true
message:
type: string()
notnull: true
relations:
ConversationPrivee:
local: conversation_id
foreign: id
onDelete: CASCADE
Membre:
local: user_id
foreign: id
onDelete: SET NULL |
Partager