Unverified Commit e2b53658 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

database: avoid needlessly incrementing backends.id

parent 9dc5d263
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -2815,6 +2815,15 @@ sub sync_stations {
sub sync_backends {
	my ($db) = @_;
	for my $service ( Travel::Status::DE::HAFAS::get_services() ) {
		my $present = $db->select(
			'backends',
			'count(*) as count',
			{
				hafas => 1,
				name  => $service->{shortname}
			}
		)->hash->{count};
		if ( not $present ) {
			$db->insert(
				'backends',
				{
@@ -2827,6 +2836,7 @@ sub sync_backends {
				{ on_conflict => undef }
			);
		}
	}

	$db->update( 'schema_version',
		{ hafas => $Travel::Status::DE::HAFAS::VERSION } );