diff --git a/erd.svg b/erd.svg new file mode 100644 index 0000000..72a7e1d --- /dev/null +++ b/erd.svg @@ -0,0 +1,724 @@ + + + + + + +dbml + + +find + + + +       find        + + +id +     +text + +(!) + + +location_id     +text + +(!) + + +user_id     +text + +(!) + + +title     +text + +(!) + + +description     +text + + +category     +text + + +rating     +integer + + +rating_count     +integer + + +is_public     +integer + + +created_at     +timestamp with time zone + +(!) + + +updated_at     +timestamp with time zone + +(!) + + + + +location + + + +       location        + + +id +     +text + +(!) + + +user_id     +text + +(!) + + +latitude     +text + +(!) + + +longitude     +text + +(!) + + +location_name     +text + + +average_rating     +integer + + +rating_count     +integer + + +created_at     +timestamp with time zone + +(!) + + + + + +find:e->location:w + + +1 +* + + + +user + + + +       user        + + +id +     +text + +(!) + + +age     +integer + + +username     +text + +(!) + + +password_hash     +text + + +google_id     +text + + +profile_picture_url     +text + + + + + +find:e->user:w + + +1 +* + + + +find_comment + + + +       find_comment        + + +id +     +text + +(!) + + +find_id     +text + +(!) + + +user_id     +text + +(!) + + +content     +text + +(!) + + +created_at     +timestamp with time zone + +(!) + + +updated_at     +timestamp with time zone + +(!) + + + + + +find_comment:e->find:w + + +1 +* + + + + +find_comment:e->user:w + + +1 +* + + + +find_like + + + +       find_like        + + +id +     +text + +(!) + + +find_id     +text + +(!) + + +user_id     +text + +(!) + + +created_at     +timestamp with time zone + +(!) + + + + + +find_like:e->find:w + + +1 +* + + + + +find_like:e->user:w + + +1 +* + + + +find_media + + + +       find_media        + + +id +     +text + +(!) + + +find_id     +text + +(!) + + +type     +text + +(!) + + +url     +text + +(!) + + +thumbnail_url     +text + + +fallback_url     +text + + +fallback_thumbnail_url     +text + + +order_index     +integer + + +created_at     +timestamp with time zone + +(!) + + + + + +find_media:e->find:w + + +1 +* + + + +find_rating + + + +       find_rating        + + +id +     +text + +(!) + + +find_id     +text + +(!) + + +user_id     +text + +(!) + + +rating     +integer + +(!) + + +created_at     +timestamp with time zone + +(!) + + +updated_at     +timestamp with time zone + +(!) + + + + + +find_rating:e->find:w + + +1 +* + + + + +find_rating:e->user:w + + +1 +* + + + +friendship + + + +       friendship        + + +id +     +text + +(!) + + +user_id     +text + +(!) + + +friend_id     +text + +(!) + + +status     +text + +(!) + + +created_at     +timestamp with time zone + +(!) + + + + + +friendship:e->user:w + + +1 +* + + + + +friendship:e->user:w + + +1 +* + + + + +location:e->user:w + + +1 +* + + + +notification + + + +       notification        + + +id +     +text + +(!) + + +user_id     +text + +(!) + + +type     +text + +(!) + + +title     +text + +(!) + + +message     +text + +(!) + + +data     +jsonb + + +is_read     +boolean + + +created_at     +timestamp with time zone + +(!) + + + + + +notification:e->user:w + + +1 +* + + + +notification_preferences + + + +       notification_preferences        + + +user_id +     +text + +(!) + + +friend_requests     +boolean + + +friend_accepted     +boolean + + +find_liked     +boolean + + +find_commented     +boolean + + +push_enabled     +boolean + + +created_at     +timestamp with time zone + +(!) + + +updated_at     +timestamp with time zone + +(!) + + + + + +notification_preferences:e->user:w + + +1 +* + + + +notification_subscription + + + +       notification_subscription        + + +id +     +text + +(!) + + +user_id     +text + +(!) + + +endpoint     +text + +(!) + + +p256dh_key     +text + +(!) + + +auth_key     +text + +(!) + + +user_agent     +text + + +is_active     +boolean + + +created_at     +timestamp with time zone + +(!) + + +updated_at     +timestamp with time zone + +(!) + + + + + +notification_subscription:e->user:w + + +1 +* + + + +session + + + +       session        + + +id +     +text + +(!) + + +user_id     +text + +(!) + + +expires_at     +timestamp with time zone + +(!) + + + + + +session:e->user:w + + +1 +* + + + diff --git a/package.json b/package.json index 045b7ef..f6c5114 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "db:push": "drizzle-kit push", "db:generate": "drizzle-kit generate", "db:migrate": "drizzle-kit migrate", - "db:studio": "drizzle-kit studio" + "db:studio": "drizzle-kit studio", + "db:generate-erd": "drizzle-erd --in ./src/lib/server/db/schema.ts --out erd.svg" }, "devDependencies": { "@eslint/compat": "^1.2.5", @@ -32,6 +33,7 @@ "@types/node": "^22", "bits-ui": "^2.11.4", "clsx": "^2.1.1", + "drizzle-erd": "0.0.1-alpha.11", "drizzle-kit": "^0.30.2", "eslint": "^9.22.0", "eslint-config-prettier": "^10.0.1",