Hard Coded Schema

Our development team has a common database schema where we can do unit testing. In addition, some of us have our own personal database schemas where we can do whatever we want. I needed to test out some performance enhancements. So I decided to create a lot of data in my personal schema.

It took about a half hour to run a script that created lots of records and set everything up. So I ran our app against this schema, hoping to first replicate the performance problem. Too bad everything ran pretty quick. Didn't take long for me to realize that the application was somehow running against the common schema.

So I dug into the code and found that our app hard codes the schema name. This is evil. It works because the offical quality and acceptance tests are run in an environment that have the same schema name. Production also has the same schema name. This only breaks down when we get to me using my personal schema to do really specialized testing.

Well I am a programmer. So I made a not to fix this hard-coded schema name everywhere in the app. But in the mean time, I guess I can do all my testing in the main common schema. Time is always of the essence for me on my project.