Issue #3 resolved

help me in using this script

Anonymous created an issue

Can you please guide me how to use this script to work

Comments (4)

  1. Philipp Benjamin Köppchen repo owner

    thank you for using my software, i'll try to help

    Here is an example:

    from locust import ManagedDatabase
    
    # sets up an interface to a managed database
    #
    # you migration files are plain SQL-files, living in migrations/, following a name
    # schema of 001_my_first_migration.sql
    db = ManagedDatabase('mysql://user@localhost/somedb', 'migrations/*.sql')
    
    # set up the table that keeps track of the migrations
    db.create_version_table() 
    
    # shows all migrations that are in the migrations directory, but not yet executed
    print db.get_pending_migrations()
    
    # execute the pending migrations. their names will be insertet in the version table, so
    # that they get executed only once
    db.migrate()
    

    please dont hesitate to ask further questions, or to point out mistakes.

  2. Log in to comment