Doctrine Migrations
  1. Doctrine Migrations
  2. DMIG-26

Remove implicit schema diff to sql in Migration tasks for explicit solution

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Labels:
      None

      Description

      Currently the following leads to an implicit drop table statement:

      public function up(Schema $schema)
       {
          $schema->dropTable("foo");
      }
      

      However this should be an explicit operation that internally puts everything onto the "addSQL" stack, then resets the schema diffs to zero by cloning the current schema into the "diff schema" again.

      public function up(Schema $schema)
       {
          $schema->dropTable("foo");
          $this->syncSchema($schema);
          $schema->dropTable("bar");
          $this->syncSchema($schema);
      }
      

        Activity

        Benjamin Eberlei created issue -
        Hide
        Beau Simensen added a comment - - edited

        So each call to syncSchema() would result in processing all changes on the schema instance (dropTable(), etc.) to actual SQL commands and placed on the "operations" stack? And at that point the schema instance should show no diffs so that any future calls to syncSchema() would only include schema changes since the previous call?

        Show
        Beau Simensen added a comment - - edited So each call to syncSchema() would result in processing all changes on the schema instance ( dropTable() , etc.) to actual SQL commands and placed on the "operations" stack? And at that point the schema instance should show no diffs so that any future calls to syncSchema() would only include schema changes since the previous call?
        Hide
        Benjamin Eberlei added a comment -

        Yes exactly

        Show
        Benjamin Eberlei added a comment - Yes exactly
        Hide
        Beau Simensen added a comment -

        Alright, I'll see what I can do. I have a feeling I will get a pretty good idea how everything works if I start digging into this one.

        Show
        Beau Simensen added a comment - Alright, I'll see what I can do. I have a feeling I will get a pretty good idea how everything works if I start digging into this one.

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DMIG-26, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: