academic / vipa

:books: Virtual Intelligent Publishing Assistant (Vipa): A journal management and publishing software
Other
128 stars 30 forks source link

duplicate subject check before creating #1743

Closed hmert closed 7 years ago

hmert commented 7 years ago

Describe issue


Subject should check for existence before creating

Exception Output


Bir hata meydana geldi.
An exception occurred while executing 'INSERT INTO subject (id, lft, rgt, root, lvl, slug, total_journal_count, created, updated, deletedAt, createdBy, updatedBy, tags, parent_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [13, 0, 0, 0, 0, "sosyal-hizmet", null, "2017-01-18 02:08:38", "2017-01-18 02:08:38", null, "", "", null, 42]:

SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "subject_pkey"
DETAIL: Key (id)=(13) already exists. 
Q A
Branch/Tag? "2.5"
Bug? yes
New feature? no
yazbahar commented 7 years ago

problem is solved. We can use ALTER SEQUENCE subject_id_seq RESTART WITH <related number> command in these cases @hmert