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 6566901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:16:19+00:00 2026-05-25T14:16:19+00:00

Is there any command in doctrine which can create db table from YAML. I

  • 0

Is there any command in doctrine which can create db table from YAML. I can see we can create YAML from DB using ./doctrine generate-yaml-db

But How can we achieve the reverse feature of this. from yaml to db.

is there any command something like this
./doctrine generate-db-yaml

  • 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-25T14:16:20+00:00Added an answer on May 25, 2026 at 2:16 pm

    Generating a database from a yaml file must be done in two steps.

    1. Generate the models from the yaml file using Doctrine_Core::generateModelsFromYaml().

    2. Generate the database from the models using Doctrine_Core::createTablesFromModels().

    I suggest writing a command-line script to call both these functions in sequence, and to automate a few other necessary steps. Here is the core of the script I use to re-generate my database.

    echo 'Deleting old models...';
    deleteAllFilesInDirectory(APPPATH . '/models/generated');
    echo "done.\n";
    
    echo 'Generating models...';
    Doctrine_Core::generateModelsFromYaml('schema.yml', APPPATH . '/models');
    echo "done.\n";
    
    echo 'Recreating database tables...';
    Doctrine_Core::dropDatabases();
    Doctrine_Core::createDatabases();
    Doctrine_Core::createTablesFromModels(APPPATH . '/models');
    echo "done.\n";
    
    echo 'Loading data...';
    Doctrine_Core::loadData('autoload.yml', 'true');
    echo "done.\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any command which can let me remove a workspace from Accurev? I
Is there any command using which we can inspect a object in command line
Is there any command that I can locate a certain table from all databases?
Is there any API or command-line able to generate a VSTemplate file from a
Is there any command line tool for Linux (FreeBSD, etc) which can modify like
Is there any command in vim with which I can jump to an already
Are there any command line scripts and/or online tools that can reverse the effects
Is there any command or tool that can recreate the schema and fill the
I'm writing a .bat script for Windows. Is there any command that I can
Is there any command which shows the decription of the error on xcode console.

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.