From 24b358115d1428858da45c34577ee0ef9f04dafb Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Sun, 19 Apr 2026 00:12:42 +0800 Subject: [PATCH] feat(discover): default discoverVisible to on for new users - Schema + migration 0007 rebuild users table with discover_visible DEFAULT true - Profile form initial state matches (checkbox pre-checked before load) - Journal when for 0007 set after 0006 so drizzle-kit migrate applies it - Spec: document default opt-in Made-with: Cursor --- app/pages/me/profile/index.vue | 2 +- .../specs/2026-04-18-discover-page-design.md | 2 +- .../drizzle-pkg/database/sqlite/schema/auth.ts | 2 +- .../drizzle-pkg/migrations/0007_vengeful_puck.sql | 28 + .../drizzle-pkg/migrations/meta/0007_snapshot.json | 1153 ++++++++++++++++++++ packages/drizzle-pkg/migrations/meta/_journal.json | 7 + 6 files changed, 1191 insertions(+), 3 deletions(-) create mode 100644 packages/drizzle-pkg/migrations/0007_vengeful_puck.sql create mode 100644 packages/drizzle-pkg/migrations/meta/0007_snapshot.json diff --git a/app/pages/me/profile/index.vue b/app/pages/me/profile/index.vue index 693afaf..e01e975 100644 --- a/app/pages/me/profile/index.vue +++ b/app/pages/me/profile/index.vue @@ -33,7 +33,7 @@ const state = reactive({ bioMarkdown: '', bioVisibility: 'private', publicSlug: '', - discoverVisible: false, + discoverVisible: true, discoverLocation: '', discoverShowLocation: false, linksJson: '[]', diff --git a/docs/superpowers/specs/2026-04-18-discover-page-design.md b/docs/superpowers/specs/2026-04-18-discover-page-design.md index 6f42641..ae7f339 100644 --- a/docs/superpowers/specs/2026-04-18-discover-page-design.md +++ b/docs/superpowers/specs/2026-04-18-discover-page-design.md @@ -26,7 +26,7 @@ | 字段(语义) | 类型建议 | 默认值 | 说明 | | --- | --- | --- | --- | -| 出现在发现中 | `integer`(0/1)或等价 boolean | **0(false)** | 默认不曝光,需用户主动打开 | +| 出现在发现中 | `integer`(0/1)或等价 boolean | **1(true)** | 默认出现在发现中,可在资料中关闭 | | 发现卡片地址文案 | `text`,可空 | `NULL` | 用户自填展示用字符串(首版不做地图/结构化省市区) | | 在发现卡片上显示地址 | `integer`(0/1) | **0(false)** | 仅当「出现在发现中」为真时有意义;避免无文案仍出现「地址」标签 | diff --git a/packages/drizzle-pkg/database/sqlite/schema/auth.ts b/packages/drizzle-pkg/database/sqlite/schema/auth.ts index 5e77864..00ed6ae 100644 --- a/packages/drizzle-pkg/database/sqlite/schema/auth.ts +++ b/packages/drizzle-pkg/database/sqlite/schema/auth.ts @@ -14,7 +14,7 @@ export const users = sqliteTable("users", { bioVisibility: text("bio_visibility").notNull().default("private"), socialLinksJson: text("social_links_json").notNull().default("[]"), avatarVisibility: text("avatar_visibility").notNull().default("private"), - discoverVisible: integer("discover_visible", { mode: "boolean" }).notNull().default(false), + discoverVisible: integer("discover_visible", { mode: "boolean" }).notNull().default(true), discoverLocation: text("discover_location"), discoverShowLocation: integer("discover_show_location", { mode: "boolean" }).notNull().default(false), createdAt: integer("created_at", { mode: "timestamp_ms" }).defaultNow().notNull(), diff --git a/packages/drizzle-pkg/migrations/0007_vengeful_puck.sql b/packages/drizzle-pkg/migrations/0007_vengeful_puck.sql new file mode 100644 index 0000000..93a3045 --- /dev/null +++ b/packages/drizzle-pkg/migrations/0007_vengeful_puck.sql @@ -0,0 +1,28 @@ +PRAGMA foreign_keys=OFF;--> statement-breakpoint +CREATE TABLE `__new_users` ( + `id` integer PRIMARY KEY NOT NULL, + `username` text NOT NULL, + `email` text, + `nickname` text, + `password` text NOT NULL, + `avatar` text, + `role` text DEFAULT 'user' NOT NULL, + `status` text DEFAULT 'active' NOT NULL, + `public_slug` text, + `bio_markdown` text, + `bio_visibility` text DEFAULT 'private' NOT NULL, + `social_links_json` text DEFAULT '[]' NOT NULL, + `avatar_visibility` text DEFAULT 'private' NOT NULL, + `discover_visible` integer DEFAULT true NOT NULL, + `discover_location` text, + `discover_show_location` integer DEFAULT false NOT NULL, + `created_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL, + `updated_at` integer DEFAULT (cast((julianday('now') - 2440587.5)*86400000 as integer)) NOT NULL +); +--> statement-breakpoint +INSERT INTO `__new_users`("id", "username", "email", "nickname", "password", "avatar", "role", "status", "public_slug", "bio_markdown", "bio_visibility", "social_links_json", "avatar_visibility", "discover_visible", "discover_location", "discover_show_location", "created_at", "updated_at") SELECT "id", "username", "email", "nickname", "password", "avatar", "role", "status", "public_slug", "bio_markdown", "bio_visibility", "social_links_json", "avatar_visibility", "discover_visible", "discover_location", "discover_show_location", "created_at", "updated_at" FROM `users`;--> statement-breakpoint +DROP TABLE `users`;--> statement-breakpoint +ALTER TABLE `__new_users` RENAME TO `users`;--> statement-breakpoint +PRAGMA foreign_keys=ON;--> statement-breakpoint +CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);--> statement-breakpoint +CREATE UNIQUE INDEX `users_public_slug_unique` ON `users` (`public_slug`); \ No newline at end of file diff --git a/packages/drizzle-pkg/migrations/meta/0007_snapshot.json b/packages/drizzle-pkg/migrations/meta/0007_snapshot.json new file mode 100644 index 0000000..0f06a16 --- /dev/null +++ b/packages/drizzle-pkg/migrations/meta/0007_snapshot.json @@ -0,0 +1,1153 @@ +{ + "version": "6", + "dialect": "sqlite", + "id": "e22db6ad-3e9e-41dd-81d5-8679bbe87cc6", + "prevId": "fb7ae2a0-2e0d-4795-a0c8-511938c5e37a", + "tables": { + "sessions": { + "name": "sessions", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "expires_at": { + "name": "expires_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "sessions_user_id_idx": { + "name": "sessions_user_id_idx", + "columns": [ + "user_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "sessions_user_id_users_id_fk": { + "name": "sessions_user_id_users_id_fk", + "tableFrom": "sessions", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "users": { + "name": "users", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "nickname": { + "name": "nickname", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "avatar": { + "name": "avatar", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'user'" + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'active'" + }, + "public_slug": { + "name": "public_slug", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bio_markdown": { + "name": "bio_markdown", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "bio_visibility": { + "name": "bio_visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'private'" + }, + "social_links_json": { + "name": "social_links_json", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "avatar_visibility": { + "name": "avatar_visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'private'" + }, + "discover_visible": { + "name": "discover_visible", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": true + }, + "discover_location": { + "name": "discover_location", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "discover_show_location": { + "name": "discover_show_location", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "users_username_unique": { + "name": "users_username_unique", + "columns": [ + "username" + ], + "isUnique": true + }, + "users_public_slug_unique": { + "name": "users_public_slug_unique", + "columns": [ + "public_slug" + ], + "isUnique": true + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "app_configs": { + "name": "app_configs", + "columns": { + "key": { + "name": "key", + "type": "text", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value_type": { + "name": "value_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "user_configs": { + "name": "user_configs", + "columns": { + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "value_type": { + "name": "value_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "user_configs_user_id_idx": { + "name": "user_configs_user_id_idx", + "columns": [ + "user_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "user_configs_user_id_users_id_fk": { + "name": "user_configs_user_id_users_id_fk", + "tableFrom": "user_configs", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "user_configs_user_id_key_pk": { + "columns": [ + "user_id", + "key" + ], + "name": "user_configs_user_id_key_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "media_assets": { + "name": "media_assets", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "storage_key": { + "name": "storage_key", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "mime": { + "name": "mime", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "size_bytes": { + "name": "size_bytes", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "variants_json": { + "name": "variants_json", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'ready'" + }, + "first_referenced_at": { + "name": "first_referenced_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "dereferenced_at": { + "name": "dereferenced_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "media_assets_storage_key_unique": { + "name": "media_assets_storage_key_unique", + "columns": [ + "storage_key" + ], + "isUnique": true + }, + "media_assets_user_id_idx": { + "name": "media_assets_user_id_idx", + "columns": [ + "user_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "media_assets_user_id_users_id_fk": { + "name": "media_assets_user_id_users_id_fk", + "tableFrom": "media_assets", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "media_refs": { + "name": "media_refs", + "columns": { + "owner_type": { + "name": "owner_type", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "owner_id": { + "name": "owner_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "asset_id": { + "name": "asset_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + } + }, + "indexes": { + "media_refs_asset_id_idx": { + "name": "media_refs_asset_id_idx", + "columns": [ + "asset_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "media_refs_asset_id_media_assets_id_fk": { + "name": "media_refs_asset_id_media_assets_id_fk", + "tableFrom": "media_refs", + "tableTo": "media_assets", + "columnsFrom": [ + "asset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": { + "media_refs_owner_type_owner_id_asset_id_pk": { + "columns": [ + "owner_type", + "owner_id", + "asset_id" + ], + "name": "media_refs_owner_type_owner_id_asset_id_pk" + } + }, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "post_comments": { + "name": "post_comments", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "post_id": { + "name": "post_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "parent_id": { + "name": "parent_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "author_user_id": { + "name": "author_user_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "guest_display_name": { + "name": "guest_display_name", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "body": { + "name": "body", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "kind": { + "name": "kind", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "deleted_at": { + "name": "deleted_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "deleted_by_user_id": { + "name": "deleted_by_user_id", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "post_comments_post_id_idx": { + "name": "post_comments_post_id_idx", + "columns": [ + "post_id" + ], + "isUnique": false + }, + "post_comments_parent_id_idx": { + "name": "post_comments_parent_id_idx", + "columns": [ + "parent_id" + ], + "isUnique": false + } + }, + "foreignKeys": { + "post_comments_post_id_posts_id_fk": { + "name": "post_comments_post_id_posts_id_fk", + "tableFrom": "post_comments", + "tableTo": "posts", + "columnsFrom": [ + "post_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "post_comments_parent_id_post_comments_id_fk": { + "name": "post_comments_parent_id_post_comments_id_fk", + "tableFrom": "post_comments", + "tableTo": "post_comments", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "post_comments_author_user_id_users_id_fk": { + "name": "post_comments_author_user_id_users_id_fk", + "tableFrom": "post_comments", + "tableTo": "users", + "columnsFrom": [ + "author_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + }, + "post_comments_deleted_by_user_id_users_id_fk": { + "name": "post_comments_deleted_by_user_id_users_id_fk", + "tableFrom": "post_comments", + "tableTo": "users", + "columnsFrom": [ + "deleted_by_user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "set null", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "posts": { + "name": "posts", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "slug": { + "name": "slug", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "body_markdown": { + "name": "body_markdown", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "excerpt": { + "name": "excerpt", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "cover_url": { + "name": "cover_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "tags_json": { + "name": "tags_json", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'[]'" + }, + "published_at": { + "name": "published_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'private'" + }, + "share_token": { + "name": "share_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "posts_user_id_slug_unique": { + "name": "posts_user_id_slug_unique", + "columns": [ + "user_id", + "slug" + ], + "isUnique": true + } + }, + "foreignKeys": { + "posts_user_id_users_id_fk": { + "name": "posts_user_id_users_id_fk", + "tableFrom": "posts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "timeline_events": { + "name": "timeline_events", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "occurred_on": { + "name": "occurred_on", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "body_markdown": { + "name": "body_markdown", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "link_url": { + "name": "link_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'private'" + }, + "share_token": { + "name": "share_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + }, + "updated_at": { + "name": "updated_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": {}, + "foreignKeys": { + "timeline_events_user_id_users_id_fk": { + "name": "timeline_events_user_id_users_id_fk", + "tableFrom": "timeline_events", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "rss_feeds": { + "name": "rss_feeds", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_url": { + "name": "feed_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "site_url": { + "name": "site_url", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_fetched_at": { + "name": "last_fetched_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "last_error": { + "name": "last_error", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "poll_interval_minutes": { + "name": "poll_interval_minutes", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "rss_feeds_user_id_feed_url_unique": { + "name": "rss_feeds_user_id_feed_url_unique", + "columns": [ + "user_id", + "feed_url" + ], + "isUnique": true + } + }, + "foreignKeys": { + "rss_feeds_user_id_users_id_fk": { + "name": "rss_feeds_user_id_users_id_fk", + "tableFrom": "rss_feeds", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + }, + "rss_items": { + "name": "rss_items", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "autoincrement": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "feed_id": { + "name": "feed_id", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "guid": { + "name": "guid", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "canonical_url": { + "name": "canonical_url", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "summary": { + "name": "summary", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "content_snippet": { + "name": "content_snippet", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "author": { + "name": "author", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "published_at": { + "name": "published_at", + "type": "integer", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "visibility": { + "name": "visibility", + "type": "text", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "'private'" + }, + "share_token": { + "name": "share_token", + "type": "text", + "primaryKey": false, + "notNull": false, + "autoincrement": false + }, + "created_at": { + "name": "created_at", + "type": "integer", + "primaryKey": false, + "notNull": true, + "autoincrement": false, + "default": "(cast((julianday('now') - 2440587.5)*86400000 as integer))" + } + }, + "indexes": { + "rss_items_feed_id_guid_unique": { + "name": "rss_items_feed_id_guid_unique", + "columns": [ + "feed_id", + "guid" + ], + "isUnique": true, + "where": "\"rss_items\".\"guid\" IS NOT NULL" + } + }, + "foreignKeys": { + "rss_items_user_id_users_id_fk": { + "name": "rss_items_user_id_users_id_fk", + "tableFrom": "rss_items", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + }, + "rss_items_feed_id_rss_feeds_id_fk": { + "name": "rss_items_feed_id_rss_feeds_id_fk", + "tableFrom": "rss_items", + "tableTo": "rss_feeds", + "columnsFrom": [ + "feed_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {} + } + }, + "views": {}, + "enums": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "indexes": {} + } +} \ No newline at end of file diff --git a/packages/drizzle-pkg/migrations/meta/_journal.json b/packages/drizzle-pkg/migrations/meta/_journal.json index f5478c2..38caf66 100644 --- a/packages/drizzle-pkg/migrations/meta/_journal.json +++ b/packages/drizzle-pkg/migrations/meta/_journal.json @@ -50,6 +50,13 @@ "when": 1776800000000, "tag": "0006_left_kitty_pryde", "breakpoints": true + }, + { + "idx": 7, + "version": "6", + "when": 1776900000000, + "tag": "0007_vengeful_puck", + "breakpoints": true } ] } \ No newline at end of file