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