Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
ORM schema tool update and default values
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Breen  
View profile  
 More options Apr 26 2012, 7:33 am
From: Chris Breen <kurl.co...@gmail.com>
Date: Thu, 26 Apr 2012 04:33:46 -0700 (PDT)
Local: Thurs, Apr 26 2012 7:33 am
Subject: ORM schema tool update and default values

Dearest Doctrine helpers,

I've been tearing my hair out for I'd say at least 3 days trying to
generate a clean update script from the schema tool.

After fixing all the foreign keys and enums (Sorry, yes, I'm using mysql).
The only differences I am left with are the default values.

I have added the columnDefinition values in a variety of different orders.
I somehow thought that the diff may have been done twice, check values then
check the generated SQL against the current SQL. This did not help.
I've also tried setting the value in the entities ala private $columnName =
value; and also in the constructor. I only tried these as this is all I
have found searching to try.

I've debugged this until I am blue in the face and I cannot figure out how
to set a default value from the entity metadata to provide the correct diff
so I do not get any changes when I run the schema tool.

I'm using Doctrine 2.2.1 with mysql.

I can provide code fragments, examples, anything. Please help :(

Thanks
Chris


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
WishCow  
View profile  
 More options Apr 26 2012, 3:05 pm
From: WishCow <vis...@gmail.com>
Date: Thu, 26 Apr 2012 12:05:50 -0700 (PDT)
Local: Thurs, Apr 26 2012 3:05 pm
Subject: Re: ORM schema tool update and default values
Doctrine does not support default values for table columns. I think I
read somewhere that the reason behind this, is that not all databases
support the notion of default values. The closest you can get, is
assigning default values to the properties, or in the constructor,
like you have done.

Although, Doctrine is pretty flexible, there may already be a MySQL
specific vendor extension, that let's you set up default values from
the mappings, maybe someone will chime in on this.

On Apr 26, 1:33 pm, Chris Breen <kurl.co...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
szjani  
View profile  
 More options Apr 27 2012, 10:29 am
From: szjani <szj...@gmail.com>
Date: Fri, 27 Apr 2012 07:29:41 -0700 (PDT)
Local: Fri, Apr 27 2012 10:29 am
Subject: Re: ORM schema tool update and default values
1. I suggest you to use doctrine-migration for modifying the existing
database.
2. Define default values in PHP in the entity classes.

On ápr. 26, 13:33, Chris Breen <kurl.co...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »