Skip to content
Snippets Groups Projects
Verified Commit c172f295 authored by Damien's avatar Damien
Browse files

FEAT #9685 Rename sequence for serial

parent 2f068a52
No related branches found
No related tags found
No related merge requests found
...@@ -251,7 +251,7 @@ switch ($mode) { ...@@ -251,7 +251,7 @@ switch ($mode) {
); );
//Last insert ID from sequence //Last insert ID from sequence
$id = $db->lastInsertId('notes_seq'); $id = $db->lastInsertId('notes_id_seq');
//Entities selected //Entities selected
if (!empty($id) && isset($_REQUEST['entities_chosen']) && !empty($_REQUEST['entities_chosen'])) if (!empty($id) && isset($_REQUEST['entities_chosen']) && !empty($_REQUEST['entities_chosen']))
......
...@@ -34,7 +34,7 @@ TRUNCATE TABLE history_batch; ...@@ -34,7 +34,7 @@ TRUNCATE TABLE history_batch;
ALTER SEQUENCE history_batch_id_seq restart WITH 1; ALTER SEQUENCE history_batch_id_seq restart WITH 1;
TRUNCATE TABLE notes; TRUNCATE TABLE notes;
ALTER SEQUENCE notes_seq restart WITH 1; ALTER SEQUENCE notes_id_seq restart WITH 1;
TRUNCATE TABLE note_entities; TRUNCATE TABLE note_entities;
......
...@@ -151,6 +151,7 @@ ALTER TABLE res_letterbox ALTER COLUMN locker_user_id SET DEFAULT NULL; ...@@ -151,6 +151,7 @@ ALTER TABLE res_letterbox ALTER COLUMN locker_user_id SET DEFAULT NULL;
ALTER TABLE notes DROP COLUMN IF EXISTS tablename; ALTER TABLE notes DROP COLUMN IF EXISTS tablename;
ALTER TABLE notes DROP COLUMN IF EXISTS coll_id; ALTER TABLE notes DROP COLUMN IF EXISTS coll_id;
ALTER TABLE notes RENAME COLUMN date_note TO creation_date; ALTER TABLE notes RENAME COLUMN date_note TO creation_date;
ALTER sequence notes_seq RENAME TO notes_id_seq;
/* PARAM LIST DISPLAY */ /* PARAM LIST DISPLAY */
......
...@@ -20,7 +20,7 @@ select setval('res_attachment_res_id_seq', (select max(res_id)+1 from res_attach ...@@ -20,7 +20,7 @@ select setval('res_attachment_res_id_seq', (select max(res_id)+1 from res_attach
select setval('res_linked_mlb_seq', (select max(id)+1 from res_linked), false); select setval('res_linked_mlb_seq', (select max(id)+1 from res_linked), false);
select setval('notif_email_stack_seq', (select max(email_stack_sid)+1 from notif_email_stack), false); select setval('notif_email_stack_seq', (select max(email_stack_sid)+1 from notif_email_stack), false);
select setval('notif_event_stack_seq', (select max(event_stack_sid)+1 from notif_event_stack), false); select setval('notif_event_stack_seq', (select max(event_stack_sid)+1 from notif_event_stack), false);
select setval('notes_seq', (select max(id)+1 from notes), false); select setval('notes_id_seq', (select max(id)+1 from notes), false);
select setval('notes_entities_id_seq', (select max(id)+1 from note_entities), false); select setval('notes_entities_id_seq', (select max(id)+1 from note_entities), false);
select setval('listinstance_id_seq', (select max(listinstance_id)+1 from listinstance), false); select setval('listinstance_id_seq', (select max(listinstance_id)+1 from listinstance), false);
select setval('listinstance_history_id_seq', (select max(listinstance_history_id)+1 from listinstance_history), false); select setval('listinstance_history_id_seq', (select max(listinstance_history_id)+1 from listinstance_history), false);
......
...@@ -108,7 +108,7 @@ class NoteModel ...@@ -108,7 +108,7 @@ class NoteModel
ValidatorModel::notEmpty($aArgs, ['identifier', 'note_text']); ValidatorModel::notEmpty($aArgs, ['identifier', 'note_text']);
ValidatorModel::intVal($aArgs, ['identifier']); ValidatorModel::intVal($aArgs, ['identifier']);
$nextSequenceId = DatabaseModel::getNextSequenceValue(['sequenceId' => 'notes_seq']); $nextSequenceId = DatabaseModel::getNextSequenceValue(['sequenceId' => 'notes_id_seq']);
DatabaseModel::insert([ DatabaseModel::insert([
'table' => 'notes', 'table' => 'notes',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment