Skip to content

Commit

Permalink
fix: sql
Browse files Browse the repository at this point in the history
  • Loading branch information
OXeu committed Jul 9, 2024
1 parent fc67dfd commit b3907cf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/page/feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export function FeedPage({ id, TOC, clean }: { id: string, TOC: () => JSX.Elemen
href={`/writing/${feed.id}`}
className="flex-1 flex flex-col items-end justify-center px-2 py bg-secondary bg-hover bg-active rounded-full transition"
>
<i className="ri-edit-2-line" />
<i className="ri-edit-2-line dark:text-neutral-400" />
</Link>
<button
aria-label={t("delete.title")}
Expand Down
23 changes: 22 additions & 1 deletion server/sql/0002.sql
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
ALTER TABLE `feeds` ADD `top` integer DEFAULT 0 NOT NULL;
CREATE TABLE IF NOT EXISTS `feeds_new` (
`id` integer PRIMARY KEY NOT NULL,
`alias` text,
`title` text,
`content` text NOT NULL,
`summary` text DEFAULT '' NOT NULL,
`listed` integer DEFAULT 1 NOT NULL,
`draft` integer DEFAULT 1 NOT NULL,
`uid` integer NOT NULL,
`top` integer DEFAULT 0 NOT NULL,
`created_at` integer DEFAULT (unixepoch()) NOT NULL,
`updated_at` integer DEFAULT (unixepoch()) NOT NULL,
FOREIGN KEY (`uid`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
INSERT INTO `feeds_new` (`id`, `alias`, `title`, `content`, `summary`, `listed`, `draft`, `uid`, `created_at`, `updated_at`)
SELECT `id`, `alias`, `title`, `content`, `summary`, `listed`, `draft`, `uid`, `created_at`, `updated_at`
FROM `feeds`;
--> statement-breakpoint
DROP TABLE `feeds`;
--> statement-breakpoint
ALTER TABLE `feeds_new` RENAME TO `feeds`;

0 comments on commit b3907cf

Please sign in to comment.