Reputation: 335
I made the mistake of defining in my schema a column named desc
which is a reserved keyword. I quickly realized my mistake and changed my schema, revising my schema column name to description
.
Now, when I run doctrine:build --all
or doctrine:build-sql
it is still generating sql based on my past mistake.
I verify this, because it is still producing the sql statement with desc
in the sentence, which has been since removed. I've cleared my cache, removed the original sql file, and cleared my logs.
How in the world is doctrine:build-sql
generating a mistake that is completely deleted and removed? How can I correct this problem?
Obviously, until I can fix it, doctrine:build
is broken.
EDIT:
Here's my original schema:
ReasonCode:
columns:
id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
desc: { type: string }
RejectionCode:
columns:
id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
desc: { type: string }
ConsiderationCode:
columns:
id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
desc: { type: string }
and here's my revised schema:
ReasonCode:
columns:
id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
name: { type: string }
RejectionCode:
columns:
id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
name: { type: string }
ConsiderationCode:
columns:
id: { type: integer, primary: true, notnull: true, autoincrement: true, unique: true }
name: { type: string }
here's the generated sql schema being generated every time:
CREATE TABLE consideration_code (id BIGINT UNIQUE AUTO_INCREMENT, desc TEXT, name TEXT, PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE reason_code (id BIGINT UNIQUE AUTO_INCREMENT, desc TEXT, name TEXT, PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE rejection_code (id BIGINT UNIQUE AUTO_INCREMENT, desc TEXT, name TEXT, PRIMARY KEY(id)) ENGINE = INNODB;
Upvotes: 0
Views: 2317
Reputation: 22756
doctrine:build-sql
generate SQL based on the generated model (the php classes). You need to regenerate the model first using doctrine:build-model
.
Don't you have an other desc
field in your schema.yml
? Have you tried to empty the folders cache
? Could you paste your schema.yml
?
Is the desc
field still in your generated model (the php file) ?
edit:
One other radical solution:
schema.yml
doctrine:clean-model-files
to clean all old modelschema.yml
(the corrected one)doctrine:build --all
Upvotes: 1