mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-05 23:19:42 +00:00
chore: fix unique index on source_match_table causing failure on insert
This commit is contained in:
parent
64f937bd14
commit
a012a8f3af
@ -19,7 +19,6 @@ import 'package:spotube/services/kv_store/kv_store.dart';
|
||||
import 'package:flutter/widgets.dart' hide Table, Key, View;
|
||||
import 'package:spotube/modules/settings/color_scheme_picker_dialog.dart';
|
||||
import 'package:drift/native.dart';
|
||||
import 'package:spotube/services/logger/logger.dart';
|
||||
import 'package:spotube/services/youtube_engine/newpipe_engine.dart';
|
||||
import 'package:spotube/services/youtube_engine/youtube_explode_engine.dart';
|
||||
import 'package:spotube/services/youtube_engine/yt_dlp_engine.dart';
|
||||
@ -212,26 +211,14 @@ class AppDatabase extends _$AppDatabase {
|
||||
);
|
||||
},
|
||||
from9To10: (m, schema) async {
|
||||
try {
|
||||
await m
|
||||
.dropColumn(schema.preferencesTable, "piped_instance")
|
||||
.catchError((e) {});
|
||||
await m
|
||||
.dropColumn(schema.preferencesTable, "invidious_instance")
|
||||
.catchError((e) {});
|
||||
await m
|
||||
.addColumn(
|
||||
schema.sourceMatchTable,
|
||||
sourceMatchTable.sourceInfo,
|
||||
)
|
||||
.catchError((e) {});
|
||||
await m
|
||||
.dropColumn(schema.sourceMatchTable, "source_id")
|
||||
.catchError((e) {});
|
||||
} catch (e) {
|
||||
AppLogger.log.e(e);
|
||||
return;
|
||||
}
|
||||
await m.dropColumn(schema.preferencesTable, "piped_instance");
|
||||
await m.dropColumn(schema.preferencesTable, "invidious_instance");
|
||||
await m.addColumn(
|
||||
schema.sourceMatchTable,
|
||||
sourceMatchTable.sourceInfo,
|
||||
);
|
||||
await customStatement("DROP INDEX IF EXISTS uniq_track_match;");
|
||||
await m.dropColumn(schema.sourceMatchTable, "source_id");
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
part of '../database.dart';
|
||||
|
||||
@TableIndex(
|
||||
name: "uniq_track_match",
|
||||
columns: {#trackId, #sourceInfo, #sourceType},
|
||||
unique: true,
|
||||
)
|
||||
class SourceMatchTable extends Table {
|
||||
IntColumn get id => integer().autoIncrement()();
|
||||
TextColumn get trackId => text()();
|
||||
|
||||
@ -2002,10 +2002,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: random_user_agents
|
||||
sha256: "19facde509a2482dababb454faf2aceff797a6ae08e80f91268c0c8a7420f03b"
|
||||
sha256: "95647149687167e82a7b39e1b4616fdebb574981b71b6f0cfca21b69f36293a8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.15"
|
||||
version: "1.0.17"
|
||||
recase:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user