6

I have 2 vhosts on my server (dev and prod) the code on both is the same, they both connect to the same database.

However, I added a new column to the table I am pulling data from and dev sees this new column, and prod does not.

I know the code is the same because they are both clones of the same repository and both updated to the latest code.

I confirmed I am dealing with the same data by altering one of the other field values and I see the change on both sides. However I keep adding new columns and dev continues to see all the new columns while prod does not. Prod does see all the columns that were there previous to today.

This does not make any sense to me. I feel like I have taken the steps to prove that this should not be happening and yet it is.

What else could it be? What could be a possible cause that I have overlooked?

2
  • 4
    Have you cleared your model caches? Commented Nov 8, 2011 at 20:48
  • 2
    @Farray, that was it. Please make that an answer so I can accept it. :) Commented Nov 8, 2011 at 20:52

2 Answers 2

16

Are all directories cloned? If '/app/config/core.php' has different debug values, I'm guessing this would be your problem. Debug levels 1 & 2 both refresh model caches at each request. Debug level 0 does not.

You could also manually force Cake to refresh the models by deleting the cached models in '/app/tmp/cache' directory on the production machine.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 I will accept when the time limit has elapsed. By the way, I have code in core.php that checks if it is the dev env or not and sets debug to either 2 or 0 accordingly. I just didn't know CakePHP cached the model's table structure. I emptied the cache file (which is not under version control) and it fixed immediately.
0

I tried it all but at the end got the solution by clearing the cache models at PROJECT\tmp\cache\models.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.