Doctrine: Mixing YAML markup and db manager (navicat) editing?
Posted
by ropstah
on Stack Overflow
See other posts from Stack Overflow
or by ropstah
Published on 2010-04-11T22:48:18Z
Indexed on
2010/04/11
22:53 UTC
Read the original article
Hit count: 179
doctrine
|inheritance
I think the answer to this question should be: No. However I hope to be corrected.
I'd like to edit our database using a mixture of YAML markup + Doctrine createTables()
and Navicat editing. Can I maintain the inheritance which is marked up?
Example (4 steps, at step 4, Doctrine is in no way able to re-create the inheritance schema... or is it?):
Step 1: Create YAML with inheritance
---
Entity:
columns:
username: string(20)
password: string(16)
created_at: timestamp
updated_at: timestamp
User:
inheritance:
extends: Entity
type: column_aggregation
keyField: type
keyValue: 1
Group:
inheritance:
extends: Entity
type: column_aggregation
keyField: type
keyValue: 2
Step 2: Create tables using Doctrine (and drop/create db if nessecary)
Created sql:
CREATE TABLE entity (id BIGINT AUTO_INCREMENT,
username VARCHAR(20),
password VARCHAR(16),
created_at DATETIME,
updated_at DATETIME,
type VARCHAR(255),
PRIMARY KEY(id)) ENGINE = INNODB
Step 3: Edit table using Navicat Step 4: Refresh YAML file because of 'external' edits...
© Stack Overflow or respective owner