Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

build(db): generate the Kysely types for the lease and session tables

Mauricefac139723e0c
diff --git a/server/src/db/kysely/SchedulerLeases.table.ts b/server/src/db/kysely/SchedulerLeases.table.ts
new file mode 100644
index 000000000..8a9f9cc52
--- /dev/null
+++ b/server/src/db/kysely/SchedulerLeases.table.ts
@@ -0,0 +1,8 @@
+// Generated by scripts/generate-db-types.ts from the migrated schema. Do not edit by hand:
+// change the migration, then run `npm run gen:db-types`.
+
+export interface SchedulerLeasesTable {
+ name: string;
+ owner: string;
+ expires_at: number;
+}
diff --git a/server/src/db/kysely/UserSessions.table.ts b/server/src/db/kysely/UserSessions.table.ts
new file mode 100644
index 000000000..5ecc243b9
--- /dev/null
+++ b/server/src/db/kysely/UserSessions.table.ts
@@ -0,0 +1,14 @@
+// Generated by scripts/generate-db-types.ts from the migrated schema. Do not edit by hand:
+// change the migration, then run `npm run gen:db-types`.
+
+import type { InsertOptional } from './columns';
+
+export interface UserSessionsTable {
+ id: string;
+ user_id: number;
+ created_at: InsertOptional<string>;
+ last_seen_at: InsertOptional<string>;
+ expires_at: string;
+ revoked_at: InsertOptional<string | null>;
+ user_agent: InsertOptional<string | null>;
+}
diff --git a/server/src/db/kysely/db.ts b/server/src/db/kysely/db.ts
index a18a7f591..097ee55c5 100644
--- a/server/src/db/kysely/db.ts
+++ b/server/src/db/kysely/db.ts
@@ -99,6 +99,7 @@ import type { RoadtripDayTracksTable } from './RoadtripDayTracks.table';
import type { RoadtripPreferencesTable } from './RoadtripPreferences.table';
import type { RoadtripViasTable } from './RoadtripVias.table';
import type { RouteUsageDailyTable } from './RouteUsageDaily.table';
+import type { SchedulerLeasesTable } from './SchedulerLeases.table';
import type { SchemaVersionTable } from './SchemaVersion.table';
import type { SchoolHolidayCountriesTable } from './SchoolHolidayCountries.table';
import type { SchoolHolidayPeriodsTable } from './SchoolHolidayPeriods.table';
@@ -121,6 +122,7 @@ import type { TripMembersTable } from './TripMembers.table';
import type { TripPhotosTable } from './TripPhotos.table';
import type { TripsTable } from './Trips.table';
import type { UserNoticeDismissalsTable } from './UserNoticeDismissals.table';
+import type { UserSessionsTable } from './UserSessions.table';
import type { UsersTable } from './Users.table';
import type { VacayCompanyHolidaysTable } from './VacayCompanyHolidays.table';
import type { VacayEntriesTable } from './VacayEntries.table';
@@ -237,6 +239,7 @@ export interface DB {
roadtrip_preferences: RoadtripPreferencesTable;
roadtrip_vias: RoadtripViasTable;
route_usage_daily: RouteUsageDailyTable;
+ scheduler_leases: SchedulerLeasesTable;
schema_version: SchemaVersionTable;
school_holiday_countries: SchoolHolidayCountriesTable;
school_holiday_periods: SchoolHolidayPeriodsTable;
@@ -259,6 +262,7 @@ export interface DB {
trip_photos: TripPhotosTable;
trips: TripsTable;
user_notice_dismissals: UserNoticeDismissalsTable;
+ user_sessions: UserSessionsTable;
users: UsersTable;
vacay_company_holidays: VacayCompanyHolidaysTable;
vacay_entries: VacayEntriesTable;