This commit is contained in:
2026-03-29 15:59:49 +03:00
parent 1f6d129fc2
commit bc8c272e63
21 changed files with 114 additions and 327 deletions
+2 -7
View File
@@ -1,11 +1,10 @@
import 'package:drift/drift.dart';
/// Transactions table
class Transactions extends Table {
TextColumn get id => text()();
RealColumn get amount => real()();
TextColumn get category => text()();
TextColumn get type => text()(); // 'income' or 'expense'
TextColumn get type => text()();
DateTimeColumn get date => dateTime()();
TextColumn get note => text().nullable()();
TextColumn get recurrence => text().withDefault(const Constant('none'))();
@@ -19,18 +18,16 @@ class Transactions extends Table {
Set<Column> get primaryKey => {id};
}
/// Categories table for custom categories
class Categories extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get name => text().withLength(min: 1, max: 50)();
TextColumn get type => text()(); // 'income' or 'expense'
TextColumn get type => text()();
TextColumn get icon => text().nullable()();
TextColumn get color => text().nullable()();
BoolColumn get isDefault => boolean().withDefault(const Constant(false))();
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
}
/// Budgets table for monthly budgets
class Budgets extends Table {
IntColumn get id => integer().autoIncrement()();
RealColumn get amount => real()();
@@ -40,7 +37,6 @@ class Budgets extends Table {
DateTimeColumn get createdAt => dateTime().withDefault(currentDateAndTime)();
}
/// Exchange rates cache
class ExchangeRates extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get fromCurrency => text()();
@@ -49,7 +45,6 @@ class ExchangeRates extends Table {
DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)();
}
/// Accounts table for multi-account support
class Accounts extends Table {
IntColumn get id => integer().autoIncrement()();
TextColumn get name => text()();