Kod
#config/doctrine/schema.yml
---
lm_chat_history:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
user_id:
type: integer
notnull: true
guest_status_id:
type: integer
notnull: true
chat_room_id:
type: integer
notnull: true
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
description:
type: string(6000)
notnull: true
visited:
type: boolean
notnull: true
default: 0
lm_chat_rooms:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
name:
type: string(50)
notnull: true
activated:
type: boolean
notnull: true
default: 0
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
created_by:
type: integer
notnull: true
lm_guest_status:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
ip:
type: string(50)
notnull: true
browser:
type: string(255)
notnull: true
host_name:
type: string(255)
notnull: true
session_id:
type: string(150)
notnull: true
last_active_time:
type: integer
notnull: true
lm_users:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
name:
type: string(25)
notnull: true
passwd:
type: string(50)
notnull: true
email:
type: string(150)
notnull: true
created_from_ip:
type: string(50)
notnull: true
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
chmod:
type: integer
notnull: true
lm_users_groups:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
name:
type: string(25)
notnull: true
activated:
type: boolean
notnull: true
default: 1
block_guest:
type: boolean
notnull: true
default: 0
block_users:
type: boolean
notnull: true
default: 0
create_user:
type: boolean
notnull: true
default: 0
remove_user:
type: boolean
notnull: true
default: 0
preview_chats:
type: boolean
notnull: true
default: 0
read_history:
type: boolean
notnull: true
default: 0
send_messages:
type: boolean
notnull: true
default: 0
kick_guest:
type: boolean
notnull: true
default: 0
kick_user:
type: boolean
notnull: true
default: 0
send_mail_to_user:
type: boolean
notnull: true
default: 0
lm_users_status:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
user_id:
type: integer
notnull: true
ip:
type: string(50)
notnull: true
browser:
type: string(255)
notnull: true
host_name:
type: string(255)
notnull: true
session_id:
type: string(150)
notnull: true
last_active_time:
type: integer
notnull: true
lm_users_to_room:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
user_id:
type: integer
notnull: true
chat_id:
type: integer
notnull: true
activated:
type: boolean
notnull: true
default: 0
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
---
lm_chat_history:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
user_id:
type: integer
notnull: true
guest_status_id:
type: integer
notnull: true
chat_room_id:
type: integer
notnull: true
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
description:
type: string(6000)
notnull: true
visited:
type: boolean
notnull: true
default: 0
lm_chat_rooms:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
name:
type: string(50)
notnull: true
activated:
type: boolean
notnull: true
default: 0
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
created_by:
type: integer
notnull: true
lm_guest_status:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
ip:
type: string(50)
notnull: true
browser:
type: string(255)
notnull: true
host_name:
type: string(255)
notnull: true
session_id:
type: string(150)
notnull: true
last_active_time:
type: integer
notnull: true
lm_users:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
name:
type: string(25)
notnull: true
passwd:
type: string(50)
notnull: true
email:
type: string(150)
notnull: true
created_from_ip:
type: string(50)
notnull: true
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
chmod:
type: integer
notnull: true
lm_users_groups:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
name:
type: string(25)
notnull: true
activated:
type: boolean
notnull: true
default: 1
block_guest:
type: boolean
notnull: true
default: 0
block_users:
type: boolean
notnull: true
default: 0
create_user:
type: boolean
notnull: true
default: 0
remove_user:
type: boolean
notnull: true
default: 0
preview_chats:
type: boolean
notnull: true
default: 0
read_history:
type: boolean
notnull: true
default: 0
send_messages:
type: boolean
notnull: true
default: 0
kick_guest:
type: boolean
notnull: true
default: 0
kick_user:
type: boolean
notnull: true
default: 0
send_mail_to_user:
type: boolean
notnull: true
default: 0
lm_users_status:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
user_id:
type: integer
notnull: true
ip:
type: string(50)
notnull: true
browser:
type: string(255)
notnull: true
host_name:
type: string(255)
notnull: true
session_id:
type: string(150)
notnull: true
last_active_time:
type: integer
notnull: true
lm_users_to_room:
actAs:
Timestampable: ~
columns:
id:
type: integer
notnull: true
primary: true
autoincrement: true
user_id:
type: integer
notnull: true
chat_id:
type: integer
notnull: true
activated:
type: boolean
notnull: true
default: 0
created_date:
type: timestamp
notnull: true
modified_date:
type: timestamp
notnull: true
Widziałem w tutorialu jobeet, że z poziomu schema.yml można tworzyć relacje, jednak nie za bardzo wiem jak to zrobić. Chciałbym, aby np. lm_users_to_room.user_id było powiązane z lm_users.id i nie wiem jak to dopisać do schema.yml. W ogóle nie wiem czy dobrze rozumiem idee relacji, według mnie kiedy usunę użytkownika baza sprawdzi powiązania z id użytkownika i usunie wszystkie wpisy lm_users_to_room.user_id o podanym user_id. Jeżeli jestem w błędzie proszę mnie z niego wyprowadzić