misc: fix insertion in previously empty table (#31655)
This commit is contained in:
parent
084b0d06b4
commit
25100cf7bd
|
@ -388,7 +388,7 @@ CREATE TABLE public.dates AS (SELECT
|
|||
labels = None
|
||||
if to_insert:
|
||||
self.ex('SELECT MAX(id) FROM {name}', ctx={'name': name})
|
||||
next_id = self.cur.fetchone()[0] + 1
|
||||
next_id = (self.cur.fetchone()[0] or 0) + 1
|
||||
ids = range(next_id, next_id + len(to_insert))
|
||||
labels = zip(ids, to_insert)
|
||||
|
||||
|
|
Loading…
Reference in New Issue