]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
docs: Combine MySQL init/reinit instructions
authorStephen Finucane <stephen.finucane@intel.com>
Wed, 10 Feb 2016 19:41:55 +0000 (19:41 +0000)
committerStephen Finucane <stephen.finucane@intel.com>
Wed, 10 Feb 2016 20:12:39 +0000 (20:12 +0000)
Apply some learnings for the Vagrant work and combine the commands used
to configure a MySQL database for first time use with those used to
reset an existing database. This should simplify installation.

Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
docs/development.md

index 8b46969c55fe00f5804f4406ca074b39e5ca840b..54b65e79dacb5bfdac63a16ae3fa2be36a6a76be 100644 (file)
@@ -137,21 +137,14 @@ To begin, export your database credentials as follows:
 
 Now, create the database. If this is your first time configuring the database,
 you must create a `patchwork` user (or similar) along with the database
-instance itself. You can do this like so:
+instance itself. The commands below will do this, dropping existing databases
+if necessary:
 
     (.venv)$ mysql -u$db_user -p$db_pass << EOF
+    DROP DATABASE IF EXISTS patchwork;
     CREATE DATABASE patchwork CHARACTER SET utf8;
-    CREATE USER 'patchwork'@'localhost' IDENTIFIED BY 'password';
-    GRANT ALL PRIVILEGES ON patchwork.* TO 'patchwork'@'localhost';
-    EOF
-
-If you're resetting your database instead, then you must drop the existing
-database and recreate it. You can do this like so:
-
-    (.venv)$ mysql -u$db_user -p$db_pass << EOF
-    DROP DATABASE patchwork;
-    CREATE DATABASE patchwork CHARACTER SET utf8;
-    GRANT ALL PRIVILEGES ON patchwork.* TO 'patchwork'@'localhost';
+    GRANT ALL PRIVILEGES ON patchwork.* TO 'patchwork'@'localhost'
+        IDENTIFIED BY 'password';
     EOF
 
 **NOTE:** The `patchwork` username and `password` password are the defaults