Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6618891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:53:45+00:00 2026-05-25T20:53:45+00:00

My boss wants the application we are currently working on to be split across

  • 0

My boss wants the application we are currently working on to be split across several schemata in the database, because he wants multiple applications — some of which I have no control over — to be able to access the data, following a naming convention like DeploymentPrefix_Category. For instance, there’d be a few schemata for production, Production_Foo, Production_Bar, and Production_Baz, and then the same for staging Staging_Foo, Staging_Bar, and Staging_Baz, and the same for development.

The problem is that while Zend_Db_Table lets me specify a schema, it doesn’t seem to let me generate that schema on the fly, which I would need to do to put that prefix on the schema.

What’s the best way to handle that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T20:53:46+00:00Added an answer on May 25, 2026 at 8:53 pm

    The issue of different configs for different environments is easily handled with Zend_Config. See the section on config in the quickstart:

    http://framework.zend.com/manual/en/learning.quickstart.create-project.html

    This allows you to specify different settings for each environment.

    As for the schemas, I’m guessing you have some tables that live in Production_Foo and others that live in Production_Bar. Consider extending Zend_Db_Table for each of these schemas and pointing to the correct database at the time of construction.

    Zend_Db_Table’s constructor is defined as follows:

    public function __construct($config = array(), $definition = null)
        { ... }
    

    When we follow through to see where $definition leads it allows you to pass an array that is loaded into Zend_Db_Table_Definition. One of the options for this is the table name:

    /**
     * @param string $tableName
     * @param array  $tableConfig
     * @return Zend_Db_Table_Definition
     */
    public function setTableConfig($tableName, array $tableConfig)
    {
        // @todo logic here
        $tableConfig[Zend_Db_Table::DEFINITION_CONFIG_NAME] = $tableName;
        $tableConfig[Zend_Db_Table::DEFINITION] = $this;
    
        if (!isset($tableConfig[Zend_Db_Table::NAME])) {
            $tableConfig[Zend_Db_Table::NAME] = $tableName;
        }
    
        $this->_tableConfigs[$tableName] = $tableConfig;
        return $this;
    }
    

    As for your schema, you just pass in different set of options for the db adapter that points to the correct one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a call log project. The boss wants me to
My boss wants me to create a desktop application with a database that is
My boss wants me to encrypt some information used during data transfer. The individual
My boss wants me to develop some apps and make them appear on the
I'm currently working on a small console application. This application is based on a
I'm working for small company, which operates in the automation industry. The boss hired
My boss wants to distribute the application for a specific client, whose number of
I'm currently developing application using DirectSound for communication on an intranet. I've had working
My boss wants me to test our web application to demonstrate how much traffic
My boss wants me to use cfscript instead of tags for database interaction. Does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.