Commits

lakin.wecker committed 4051df4

drop the table first before creating it, if it exists.

Comments (0)

Files changed (1)

baste/__init__.py

 
     #---------------------------------------------------------------------------
     def __call__(self):
+        # Drop the db
+        sql = "DROP DATABASE IF EXISTS %(db)s; "
+        sql = sql % { 'db': self.db_name, }
+        command = "echo \"%s\" | mysql -p -u root" % (sql,)
+        print command
+        baste_env.run(command)
+
+        # Re create it.
         sql = "CREATE DATABASE %(db)s; " + \
             "GRANT ALL ON %(db)s.* to %(user)s@localhost IDENTIFIED BY '%(pw)s';"
         sql = sql % {