php - Rollback a particular migration? -


is possible rollback particular migration in laravel?

for example:

if make 4 migration m1, m2, m3 , m4 , later decided add more fields in m2. can roll way directly m2? or edit existing m2 migration file directly?

the best practice @farkie's comment, create new migration. if want hack, way laravel rollbacks migrations this: on migrations tables there column called 'batch' when rollback executed records biggest batch number rollbacked , records of rollbacked migrations deleted migrations table.

a way hack be:

if migrations table like:

migration   |   batch =========================== m1               |    1 m2               |    1 m3               |    1 m4               |    1 

edit table looks like

migration   |   batch =========================== m1               |    1 m2               |    2 m3               |    2 m4               |    2 

so when rolling rollback m2, m3 , m4, changes , migrate again


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -