2024-08-27 07:22:18 +00:00
|
|
|
part of '../database.dart';
|
|
|
|
|
|
|
|
enum SourceType {
|
2024-08-27 08:37:31 +00:00
|
|
|
youtube._('YouTube'),
|
|
|
|
youtubeMusic._('YouTube Music');
|
2024-08-27 07:22:18 +00:00
|
|
|
|
|
|
|
final String label;
|
|
|
|
|
|
|
|
const SourceType._(this.label);
|
|
|
|
}
|
|
|
|
|
|
|
|
@TableIndex(
|
2024-08-27 08:37:31 +00:00
|
|
|
name: 'uniq_track_match',
|
2024-08-27 07:22:18 +00:00
|
|
|
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)();
|
|
|
|
}
|