Use utc datetimes to fix test

This commit is contained in:
Simon Binder
2025-10-26 22:49:25 +01:00
parent e303d14d8b
commit 4e8fe8554b
5 changed files with 6 additions and 6 deletions
@@ -73,7 +73,7 @@
"lexeme": "DateTime",
"import_uri": "dart:core"
},
"(1900)))"
".utc(1900)))"
]
}
}
@@ -329,7 +329,7 @@
"sql": [
{
"dialect": "sqlite",
"sql": "CREATE TABLE IF NOT EXISTS \"users\" (\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, \"name\" TEXT NOT NULL DEFAULT 'name', \"birthday\" TEXT NULL CHECK(JULIANDAY(\"birthday\") > JULIANDAY('1900-01-01T00:00:00.000 +01:00')), \"next_user\" INTEGER NULL REFERENCES users (id), UNIQUE (\"name\", \"birthday\"), CHECK (LENGTH(name) < 10));"
"sql": "CREATE TABLE IF NOT EXISTS \"users\" (\"id\" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, \"name\" TEXT NOT NULL DEFAULT 'name', \"birthday\" TEXT NULL CHECK(JULIANDAY(\"birthday\") > JULIANDAY('1900-01-01T00:00:00.000Z')), \"next_user\" INTEGER NULL REFERENCES users (id), UNIQUE (\"name\", \"birthday\"), CHECK (LENGTH(name) < 10));"
}
]
},
@@ -30,7 +30,7 @@ class $UsersTable extends Users with TableInfo<$UsersTable, User> {
late final GeneratedColumn<DateTime> birthday = GeneratedColumn<DateTime>(
'birthday', aliasedName, true,
check: () =>
ComparableExpr(birthday).isBiggerThan(Constant(DateTime(1900))),
ComparableExpr(birthday).isBiggerThan(Constant(DateTime.utc(1900))),
type: DriftSqlType.dateTime,
requiredDuringInsert: false);
static const VerificationMeta _nextUserMeta =
@@ -769,7 +769,7 @@ i1.GeneratedColumn<String> _column_20(String aliasedName) => i1.GeneratedColumn<
String>('birthday', aliasedName, true,
type: i1.DriftSqlType.string,
$customConstraints:
'NULL CHECK (JULIANDAY(birthday) > JULIANDAY(\'1900-01-01T00:00:00.000 +01:00\'))');
'NULL CHECK (JULIANDAY(birthday) > JULIANDAY(\'1900-01-01T00:00:00.000Z\'))');
i1.GeneratedColumn<int> _column_21(String aliasedName) =>
i1.GeneratedColumn<int>('next_user', aliasedName, true,
type: i1.DriftSqlType.int,
+1 -1
View File
@@ -12,7 +12,7 @@ class Users extends Table {
DateTimeColumn get birthday => dateTime()
.nullable()
// ignore: recursive_getters
.check(birthday.isBiggerThan(Constant(DateTime(1900))))();
.check(birthday.isBiggerThan(Constant(DateTime.utc(1900))))();
IntColumn get nextUser => integer().nullable().references(Users, #id)();
@@ -27,7 +27,7 @@ class Users extends Table with TableInfo<Users, UsersData> {
type: DriftSqlType.string,
requiredDuringInsert: false,
$customConstraints:
'NULL CHECK (JULIANDAY(birthday) > JULIANDAY(\'1900-01-01T00:00:00.000 +01:00\'))');
'NULL CHECK (JULIANDAY(birthday) > JULIANDAY(\'1900-01-01T00:00:00.000Z\'))');
late final GeneratedColumn<int> nextUser = GeneratedColumn<int>(
'next_user', aliasedName, true,
type: DriftSqlType.int,