Discussion:
Database schema and entities not updating from orm metadata
Apot
2012-05-18 21:02:23 UTC
Permalink
I am having trouble changing the database schema and entities by changing
the doctrine orm metadata

I imported a database and all the orm.yml files were created perfect. I was
able to create all entities from this import.

Now when I change the orm.yml files and try:
php app/console doctrine:schema:update --force
It doesn't change the database schema. The connection is correct because
the entities work with no problems.

If I do:
php app/console doctrine:schema:update --dump-sql

It shows:
ALTER TABLE accounttypes CHANGE description description VARCHAR(45) NOT NULL

but I can force this query as many times as I want and it always says it
needs to be done. I have tried DoctrineMigrationsBundle abd the same query
appears and is executed and after still needs to be executed.

I can even change AccountTypes.orm.yml to something completely different
and It just say the original query.

The original AccountTypes.orm.yml
type: entity
table: accounttypes
id: true
type: string
length: 45
fixed: false
nullable: false
strategy: IDENTITY
lifecycleCallbacks: { }
After I change it
Accounttypes:
type: entity
table: accounttypes
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
description:
id: true
type: string
length: 50

lifecycleCallbacks: { }

Still gives the same query needed to be executed. I have removed the cache
php app/console cache:clear --env=prod; php app/console cache:clear
--env=dev
Nothing happened

I have deleted the cache folders; same thing.

Does anybody have any ideas?
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2-/***@public.gmane.org
To unsubscribe from this group, send email to
symfony2+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
Nicolas
2012-05-19 12:50:49 UTC
Permalink
I think this is more an probleme becoming from doctrine, maybe can you
try to
send the sql command by phpmyadmin or another sql manager, in few
cases
this could be a problem which don't emit error (cause by sql version
or other).

So test that if you can access a sql manager and send the result. This
would be
interessant to undersand why this arrives.
Post by Apot
I am having trouble changing the database schema and entities by changing
the doctrine orm metadata
I imported a database and all the orm.yml files were created perfect. I was
able to create all entities from this import.
php app/console doctrine:schema:update --force
It doesn't change the database schema. The connection is correct because
the entities work with no problems.
php app/console doctrine:schema:update --dump-sql
ALTER TABLE accounttypes CHANGE description description VARCHAR(45) NOT NULL
but I can force this query as many times as I want and it always says it
needs to be done. I have tried DoctrineMigrationsBundle abd the same query
appears and is executed and after still needs to be executed.
I can even change AccountTypes.orm.yml to something completely different
and It just say the original query.
The original AccountTypes.orm.yml
  type: entity
  table: accounttypes
      id: true
      type: string
      length: 45
      fixed: false
      nullable: false
        strategy: IDENTITY
  lifecycleCallbacks: {  }
After I change it
  type: entity
  table: accounttypes
      type: integer
      generator: { strategy: AUTO }
      id: true
      type: string
      length: 50
lifecycleCallbacks: {  }
Still gives the same query needed to be executed. I have removed the cache
php app/console cache:clear --env=prod; php app/console cache:clear
--env=dev
Nothing happened
I have deleted the cache folders; same thing.
Does anybody have any ideas?
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2-/***@public.gmane.org
To unsubscribe from this group, send email to
symfony2+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
Lachlan Pease
2012-05-21 06:41:41 UTC
Permalink
What database are you using for your schema? Have you checked whether the
change has actually been applied to the database?

This seems similar to a problem I experienced while implementing a
varbinary type (http://www.doctrine-project.org/jira/browse/DBAL-276).
In my case, it was caused by the SchemaManager not returning the length of
the column properly, from _getPortableTableColumnDefinition()

That should give you a starting point as to where to look - if it turns out
to be a bug in doctrine-dbal, don't forget to post an issue to Doctrine's
JIRA (linked above)!
Post by Apot
I am having trouble changing the database schema and entities by changing
the doctrine orm metadata
I imported a database and all the orm.yml files were created perfect. I
was able to create all entities from this import.
php app/console doctrine:schema:update --force
It doesn't change the database schema. The connection is correct because
the entities work with no problems.
php app/console doctrine:schema:update --dump-sql
ALTER TABLE accounttypes CHANGE description description VARCHAR(45) NOT NULL
but I can force this query as many times as I want and it always says it
needs to be done. I have tried DoctrineMigrationsBundle abd the same
query appears and is executed and after still needs to be executed.
I can even change AccountTypes.orm.yml to something completely different
and It just say the original query.
The original AccountTypes.orm.yml
type: entity
table: accounttypes
id: true
type: string
length: 45
fixed: false
nullable: false
strategy: IDENTITY
lifecycleCallbacks: { }
After I change it
type: entity
table: accounttypes
type: integer
generator: { strategy: AUTO }
id: true
type: string
length: 50
lifecycleCallbacks: { }
Still gives the same query needed to be executed. I have removed the cache
php app/console cache:clear --env=prod; php app/console cache:clear
--env=dev
Nothing happened
I have deleted the cache folders; same thing.
Does anybody have any ideas?
--
If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "Symfony2" group.
To post to this group, send email to symfony2-/***@public.gmane.org
To unsubscribe from this group, send email to
symfony2+unsubscribe-/***@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/symfony2?hl=en
Loading...