@@ -179,6 +179,8 @@ def apply_local_patches(config, tree) -> List:
179
179
def db_insert (config , state , name ):
180
180
global psql_conn
181
181
182
+ # Branches usually have a trailing separator
183
+ pfx = config .get ("target" , "branch_pfx" )[:- 1 ]
182
184
pub_url = config .get ('target' , 'public_url' )
183
185
row = {"branch" : name ,
184
186
"date" : state ["branches" ][name ],
@@ -187,9 +189,11 @@ def db_insert(config, state, name):
187
189
row |= state ["info" ][name ]
188
190
189
191
with psql_conn .cursor () as cur :
190
- arg = cur .mogrify ("(%s,%s,%s,%s,%s)" , (row ["branch" ], row ["date" ], row ["base" ], row ["url" ],
191
- json .dumps (row )))
192
- cur .execute ("INSERT INTO branches VALUES " + arg .decode ('utf-8' ))
192
+ cols = "(branch, stream, t_date, base, url, info)"
193
+ arg = cur .mogrify ("(%s,%s,%s,%s,%s,%s)" ,
194
+ (row ["branch" ], pfx , row ["date" ], row ["base" ],
195
+ row ["url" ], json .dumps (row )))
196
+ cur .execute (f"INSERT INTO branches { cols } VALUES " + arg .decode ('utf-8' ))
193
197
194
198
195
199
def generate_deltas (config , tree , name ):
0 commit comments