[DMIG-26] Remove implicit schema diff to sql in Migration tasks for explicit solution Created: 16/Nov/11  Updated: 21/Nov/11

Status: Open
Project: Doctrine Migrations
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
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);
}


 Comments   
Comment by Beau Simensen [ 20/Nov/11 ]

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?

Comment by Benjamin Eberlei [ 20/Nov/11 ]

Yes exactly

Comment by Beau Simensen [ 21/Nov/11 ]

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.

Generated at Sun Oct 26 01:13:02 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.