Doctrine Project

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Doctrine 2 - ORM
  • Doctrine 2 - ORM
  • DDC-114

Extend Drop Schema

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0-ALPHA2
  • Fix Version/s: 2.0-ALPHA3
  • Component/s: Tools
  • Security Level: All
  • Labels:
    None

Description

Currently drop schema infers from the current metadata model which tables have to be dropped.

However when your schema changes and you then want to regenerate the database the tables may have changed and SQL errors like "table does not exist" may occur.

Therefore I propose to extend dropSchema() to have four modes:

  • "metadata" - Drop schema of the current metadata model.
  • "force-metadata" - Drop schema of the current metadata model, even if some tables don't exist.
  • "database" - Drop all tables of a database.
  • "orphans" - Drop all tables that are in the database but not in the metadata model.

Issue Links

is duplicated by

New Feature - A new feature of the product, which has yet to be developed. DDC-99 Add dropOrphanedTables() command to SchemaTool

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • Source
Hide
Permalink
Benjamin Eberlei added a comment - 04/Nov/09 5:44 PM

Because of Bug DDC-98 the orphans command is a bit dangerous as of now, but the rest will be implemented for now. There are other problems also with orphans.

Show
Benjamin Eberlei added a comment - 04/Nov/09 5:44 PM Because of Bug DDC-98 the orphans command is a bit dangerous as of now, but the rest will be implemented for now. There are other problems also with orphans.
Hide
Permalink
Benjamin Eberlei added a comment - 04/Nov/09 6:28 PM

This is a bit more complicated because of foreign key constraints.

The algorithm for "database" should work like the following:

1. Sort the Database Tables according to the Classes given by CommitOrderCalculator.
2. List the tables of the database and append the additional tables to the stack.

Also force can be dropped by first retrieving a list of all the tables of a database and diff'ing the tables to be dropped.

Show
Benjamin Eberlei added a comment - 04/Nov/09 6:28 PM This is a bit more complicated because of foreign key constraints. The algorithm for "database" should work like the following: 1. Sort the Database Tables according to the Classes given by CommitOrderCalculator. 2. List the tables of the database and append the additional tables to the stack. Also force can be dropped by first retrieving a list of all the tables of a database and diff'ing the tables to be dropped.
Hide
Permalink
Benjamin Eberlei added a comment - 05/Nov/09 8:51 AM

Implemented a new mode "database" which drops all tables in the database, first the metadata tables based on commit order calculations, then the missing tables.

Additionally implemented a filter which deletes tables from the to drop list when they don't exist yet (which is relevant when metadata is changing alot).

Show
Benjamin Eberlei added a comment - 05/Nov/09 8:51 AM Implemented a new mode "database" which drops all tables in the database, first the metadata tables based on commit order calculations, then the missing tables. Additionally implemented a filter which deletes tables from the to drop list when they don't exist yet (which is relevant when metadata is changing alot).

People

  • Assignee:
    Benjamin Eberlei
    Reporter:
    Benjamin Eberlei
Vote (1)
Watch (0)

Dates

  • Created:
    04/Nov/09 5:27 PM
    Updated:
    05/Nov/09 8:51 AM
    Resolved:
    05/Nov/09 8:51 AM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Doctrine Project. Try JIRA - bug tracking software for your team.