mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
stableee
This commit is contained in:
@@ -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()();
|
||||
|
||||
Reference in New Issue
Block a user