From 98a31d53ef19a2b556056549492c211ddfe7fad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schleu=C3=9Fer?= Date: Wed, 22 Mar 2017 16:15:01 +0100 Subject: [PATCH] Modify schema to get install/upgrade work with db-mssql. Although the problem appears in step 209, the real cause is the combination of steps 200 and 201. The Index ('user_id','name') created in step 201 (with a nullable 'user_id' as of step 200) forbids the alteration of 'user_id' to NOTNULL in step 209, at least with mssql. So fix this in step 200 and set 'user_id' NOTNULL right from start. While this is a 'post release' change, it is justifiable as it happens in the same install/upgrade sequence and the final db (schema) is identical. Fixes #22063 --- admin/schema.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/schema.php b/admin/schema.php index 05125fe389..47ab88bb44 100644 --- a/admin/schema.php +++ b/admin/schema.php @@ -846,7 +846,7 @@ # $g_upgrade[200] = array('CreateTableSQL', array( db_get_table( 'api_token' ), " id I UNSIGNED NOTNULL PRIMARY AUTOINCREMENT, - user_id I DEFAULT '0', + user_id I NOTNULL DEFAULT '0', name C(128) NOTNULL, hash C(128) NOTNULL, date_created I UNSIGNED NOTNULL DEFAULT '0',