Giter VIP home page Giter VIP logo

drush-uroll's Introduction

drush-uroll

###Update Rollback

When you are writting complicated drupal module update functions it's often necessary to run the update function over and over.

But when you run "drush updb" after the required update function has already been run, your drush updb will simply say there is nothing to update. But, but, I want to run the update again you say! And since your a well accomplished drupal developer you could go into the mysql system table and modify the version of the module manually and then you'll be running your test update function again just fine.

BUT why do that when a simple drush module can do it for you.

Example:

Rollback the system table so that drupal thinks it has not run the update for myJeff_module version 12

 drush uroll --module=myJeff_module --version=12       

Options:

--module module to change the update function version on

--version Version to set to roll back to

##Output:

I'm leaving the debugging output in there for now. It just prints the data structure of the version that the update function is currently at, and then the data structure of the system table element after the uroll has run. This just gives you a warm fuzzy feeling that it actually did something.

The output should look something like this:

drush uroll --module=vcd_admin --version=2  
Array   (    [name] => vcd_admin   [schema_version] => 3   )    
Array    (
    [name] => vcd_admin
    [schema_version] => 2
)

##Installation:

Just put the uroll.drush.inc file in your ~/.drush directory.

##Benefits:

By writing more and more update functions you'll learn the guts of drupal quickly and eventually not have to repeat a bunch of error pron mouse clicks on a production server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.