From 34c8ab53dc20b70f840281e8a94cf75b59c1bae6 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Wed, 7 Aug 2013 00:48:43 +0300 Subject: [PATCH] Make seq autoincrement --- appinfo/database.xml | 27 ++++++++++++++++++--------- lib/op.php | 3 +-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/appinfo/database.xml b/appinfo/database.xml index 8830477a..103d7d9a 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -51,6 +51,16 @@ *dbprefix*office_op + + seq + integer + 1 + true + 1 + true + 4 + Sequence number + es_id text @@ -58,14 +68,6 @@ 64 Editing session id - - seq - integer - 1 - true - 4 - Sequence number - member text @@ -79,7 +81,14 @@ false json-string - + + seq_pKey + true + + seq + ascending + + office_op_eis_index true diff --git a/lib/op.php b/lib/op.php index 0207b69c..829bf213 100644 --- a/lib/op.php +++ b/lib/op.php @@ -5,10 +5,9 @@ namespace OCA\Office; class Op { public static function add($op){ - $query = \OCP\DB::prepare('INSERT INTO `*PREFIX*office_op` (`es_id`, `seq`, `member`, `opspec`) VALUES (?, ?, ?, ?) '); + $query = \OCP\DB::prepare('INSERT INTO `*PREFIX*office_op` (`es_id`, `member`, `opspec`) VALUES (?, ?, ?) '); $result = $query->execute(array( $op['es_id'], - $op['seq'], $op['member'], $op['opspec'], ));