Make seq autoincrement

pull/1/head
Victor Dubiniuk 11 years ago committed by Tobias Hintze
parent 4497ba092f
commit 34c8ab53dc

@ -51,21 +51,23 @@
<table>
<name>*dbprefix*office_op</name>
<declaration>
<field>
<name>es_id</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
<comments>Editing session id</comments>
</field>
<field>
<name>seq</name>
<type>integer</type>
<default>1</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<unsigned>true</unsigned>
<length>4</length>
<comments>Sequence number</comments>
</field>
<field>
<name>es_id</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
<comments>Editing session id</comments>
</field>
<field>
<name>member</name>
<type>text</type>
@ -79,7 +81,14 @@
<notnull>false</notnull>
<comments>json-string</comments>
</field>
<index>
<name>seq_pKey</name>
<primary>true</primary>
<field>
<name>seq</name>
<sorting>ascending</sorting>
</field>
</index>
<index>
<name>office_op_eis_index</name>
<unique>true</unique>

@ -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'],
));

Loading…
Cancel
Save