Some checks are pending
Backend CI / test (push) Waiting to run
Backend CI / build (push) Blocked by required conditions
Deploy Admin Panel / Deploy Admin Panel (push) Waiting to run
Deploy Admin Panel / Admin Panel Verification (push) Blocked by required conditions
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
28 lines
1 KiB
Dart
28 lines
1 KiB
Dart
import 'package:drift/drift.dart';
|
|
import 'package:drift_postgres/drift_postgres.dart';
|
|
import '../converters.dart' show generateUuid;
|
|
|
|
/// Таблица ShareRequests - запросы на шаринг через Telegram
|
|
class ShareRequests extends Table {
|
|
// ID как String, но фактически UUID (генерируется PostgreSQL на стороне БД)
|
|
TextColumn get id => text()
|
|
.withDefault(const CustomExpression('gen_random_uuid()::text'))();
|
|
|
|
TextColumn get telegramUserId => text()();
|
|
TextColumn get telegramUsername => text().nullable()();
|
|
|
|
TextColumn get sharedCardId => text()
|
|
.nullable()();
|
|
|
|
Column<PgDateTime> get requestedAt => customType(PgTypes.timestampWithTimezone)
|
|
.withDefault(now())();
|
|
|
|
// Audit
|
|
Column<PgDateTime> get createdAt => customType(PgTypes.timestampWithTimezone)
|
|
.withDefault(now())();
|
|
Column<PgDateTime> get updatedAt => customType(PgTypes.timestampWithTimezone)
|
|
.withDefault(now())();
|
|
|
|
@override
|
|
Set<Column> get primaryKey => {id};
|
|
}
|