You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The groups keyword is reserved in mysql but can still have tables
using this name if they are quoted with backticks (`). Additionally,
default values cannot be specified for TEXT types unless wrapped in
parentheses.
Signed-off-by: Billy Olsen <[email protected]>
Copy file name to clipboardExpand all lines: mysql.go
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -44,15 +44,15 @@ CREATE TABLE IF NOT EXISTS users (
44
44
passbcrypt VARCHAR(64) DEFAULT '',
45
45
otpsecret VARCHAR(64) DEFAULT '',
46
46
yubikey VARCHAR(128) DEFAULT '',
47
-
sshkeys TEXT DEFAULT '',
48
-
custattr TEXT DEFAULT '{}')
47
+
sshkeys TEXT DEFAULT (''),
48
+
custattr TEXT DEFAULT ('{}'))
49
49
`)
50
50
statement.Exec()
51
51
statement, _=db.Prepare("CREATE UNIQUE INDEX idx_user_name on users(name)")
52
52
statement.Exec()
53
-
statement, _=db.Prepare("CREATE TABLE IF NOT EXISTS groups (id INTEGER AUTO_INCREMENT PRIMARY KEY, name VARCHAR(64) NOT NULL, gidnumber INTEGER NOT NULL)")
53
+
statement, _=db.Prepare("CREATE TABLE IF NOT EXISTS `groups` (id INTEGER AUTO_INCREMENT PRIMARY KEY, name VARCHAR(64) NOT NULL, gidnumber INTEGER NOT NULL)")
54
54
statement.Exec()
55
-
statement, _=db.Prepare("CREATE UNIQUE INDEX idx_group_name on groups(name)")
55
+
statement, _=db.Prepare("CREATE UNIQUE INDEX idx_group_name on `groups`(name)")
56
56
statement.Exec()
57
57
statement, _=db.Prepare("CREATE TABLE IF NOT EXISTS includegroups (id INTEGER AUTO_INCREMENT PRIMARY KEY, parentgroupid INTEGER NOT NULL, includegroupid INTEGER NOT NULL)")
58
58
statement.Exec()
@@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS users (
0 commit comments