Skip to content

Commit

Permalink
chore(analytics): migrate schema to drizzle
Browse files Browse the repository at this point in the history
  • Loading branch information
ABCxFF committed Aug 25, 2024
1 parent ffc78c5 commit 641611d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
16 changes: 0 additions & 16 deletions modules/analytics/db/migrations/20240813023547_init/migration.sql

This file was deleted.

3 changes: 0 additions & 3 deletions modules/analytics/db/migrations/migration_lock.toml

This file was deleted.

11 changes: 11 additions & 0 deletions modules/analytics/db/schema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Query, schema, uniqueIndex, index } from "./schema.gen.ts";

export const events = schema.table("events", {
id: Query.uuid("id").primaryKey().defaultRandom(),
timestamp: Query.timestamp("timestamp"),
name: Query.text("name"),
metadata: Query.jsonb("metadata")
}, (table) => ({
eventId: uniqueIndex("event_id").on(table.id),
eventNameTime: index("event_name_time").on(table.name, Query.desc(table.timestamp))
}));

0 comments on commit 641611d

Please sign in to comment.