RhythmBox/lib/services/database/tables/source_match.dart

27 lines
688 B
Dart
Raw Permalink Normal View History

part of '../database.dart';
enum SourceType {
youtube._('YouTube'),
2024-09-04 15:28:59 +00:00
youtubeMusic._('YouTube Music'),
2024-09-06 14:19:26 +00:00
netease._('Netease Music'),
kugou._('Kugou Music');
final String label;
const SourceType._(this.label);
}
@TableIndex(
name: 'uniq_track_match',
columns: {#trackId, #sourceId, #sourceType},
unique: true,
)
class SourceMatchTable extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get trackId => text()();
TextColumn get sourceId => text()();
TextColumn get sourceType =>
textEnum<SourceType>().withDefault(Constant(SourceType.youtube.name))();
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
}