From e386bf6b58876436e8048ab327da883cc3dfb108 Mon Sep 17 00:00:00 2001
From: Badlop <badlop@process-one.net>
Date: Tue, 29 Mar 2016 12:37:49 +0200
Subject: In SQL files create Users table with SCRAM support by default (#956)

---
 sql/mysql.sql | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'sql/mysql.sql')

diff --git a/sql/mysql.sql b/sql/mysql.sql
index cc603c1b..f08b3a4b 100644
--- a/sql/mysql.sql
+++ b/sql/mysql.sql
@@ -19,10 +19,13 @@
 CREATE TABLE users (
     username varchar(191) PRIMARY KEY,
     password text NOT NULL,
+    serverkey text NOT NULL DEFAULT '',
+    salt text NOT NULL DEFAULT '',
+    iterationcount integer NOT NULL DEFAULT 0,
     created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
 ) ENGINE=InnoDB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
 
--- To support SCRAM auth:
+-- Add support for SCRAM auth to a database created before ejabberd 16.03:
 -- ALTER TABLE users ADD COLUMN serverkey text NOT NULL DEFAULT '';
 -- ALTER TABLE users ADD COLUMN salt text NOT NULL DEFAULT '';
 -- ALTER TABLE users ADD COLUMN iterationcount integer NOT NULL DEFAULT 0;
-- 
cgit v1.2.3

