Hey,
I am developing a small application to test 1.2. My schema is:
Profile:
columns:
first_name: string(25)
middle_name: string(25)
last_name: string(25)
email_address: string(255)
title: string(25)
Site:
actAs:
Timestampable: ~
columns:
title:
type: string(50)
notnull: true
plant_manager_id:
type: integer(4)
production_manager_id:
type: integer(4)
technical_manager_id:
type: integer(4)
quality_manager_id:
type: integer(4)
security_manager_id:
type: integer(4)
site_administrator_id:
type: integer(4)
notnull: true
opened_problems:
type: integer(4)
closed_problems:
type: integer(4)
total_problems:
type: integer(4)
opened_tasks:
type: integer(4)
closed_tasks:
type: integer(4)
total_tasks:
type: integer(4)
relations:
PlantManager:
class: Profile
local: plant_manager_id
foreign: id
foreignType: many
type: one
ProductionManager:
class: Profile
local: production_manager_id
foreign: id
foreignType: many
type: one
TechnicalManager:
class: Profile
local: technical_manager_id
foreign: id
foreignType: many
type: one
QualityManager:
class: Profile
local: quality_manager_id
foreign: id
foreignType: many
type: one
SecurityManager:
class: profile
local: security_manager_id
foreign: id
foreignType: many
type: one
Problem:
actAs:
Timestampable: ~
Sluggable:
fields: [title]
columns:
site_id:
type: integer(4)
notnull: true
title:
type: string(100)
notnull: true
background:
type: string(4000)
notnull: true
status:
type: boolean
notnull: true
default: 0
token:
type: string(255)
notnull: true
unique: true
expires_at:
type: timestamp
notnull: true
relations:
Site:
class: Site
onDelete: CASCADE
local: site_id
foreign: id
foreignType: many
type: one
Investigation:
actAs:
Timestampable: ~
columns:
status_id:
type: integer(4)
notnull: true
problem_id:
type: integer(4)
notnull: true
current_condition:
type: string(4000)
current_condition_sketchup:
type: string(255)
cause_analysis:
type: string(4000)
cause_analysis_sketchup:
type: string(255)
target_condition:
type: string(4000)
target_condition_sketchup:
type: string(255)
follow_up_plan:
type: string(2000)
actual_results:
type: string(2000)
relations:
Problem:
class: Problem
onDelete: CASCADE
local: problem_id
foreign: id
foreignType: many
type: one
Action:
actAs:
Timestampable: ~
columns:
investigation_id:
type: integer(4)
notnull: true
title:
type: string(100)
notnull: true
what:
type: string(100)
notnull: true
leader_id:
type: integer
notnull: true
targatefinisheddate:
type: timestamp
notnull: true
whereisaction:
type: string(100)
remark:
type: string(100)
relations:
Investigation:
class: Investigation
onDelete: CASCADE
local: investigation_id
foreign: id
foreignType: many
type: one
When I do symfony doctrine:build-all I get :
SQLSTATE[HY000]: General error: 1005 Can't create table '.\solveet
\#sql-d90_10a.frm' (errno: 150). Failing Query: ALTER TABLE
solveet_action ADD FOREIGN KEY (investigation_id) REFERENCES
solveet_investigation(id)
I am not sure I set the relations correctly. Basically:
* One site can create several problems. For each problem, we can
create several investigations. For each investigation, we can have
several actions.
* When a site is created, production manager, quality manager and so
on are defined using the profile table (it contains users
information).
Thanks in advance for those who can help !!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---