Skip to content

Commit

Permalink
fix: use created at date for pastes, and order the endpoint by that d…
Browse files Browse the repository at this point in the history
…ate.
  • Loading branch information
bjarneo committed Jan 27, 2024
1 parent 87c342c commit 8978f08
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
38 changes: 38 additions & 0 deletions prisma/migrations/20240127170241_created_at/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Secret" (
"id" TEXT NOT NULL PRIMARY KEY,
"data" TEXT NOT NULL,
"title" TEXT,
"maxViews" INTEGER NOT NULL DEFAULT 1,
"password" TEXT,
"allowed_ip" TEXT,
"preventBurn" BOOLEAN NOT NULL DEFAULT false,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expiresAt" DATETIME NOT NULL,
"user_id" TEXT,
"isPublic" BOOLEAN NOT NULL DEFAULT false,
"ipAddress" TEXT NOT NULL DEFAULT '',
CONSTRAINT "Secret_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
INSERT INTO "new_Secret" ("allowed_ip", "data", "expiresAt", "id", "ipAddress", "isPublic", "maxViews", "password", "preventBurn", "title", "user_id") SELECT "allowed_ip", "data", "expiresAt", "id", "ipAddress", "isPublic", "maxViews", "password", "preventBurn", "title", "user_id" FROM "Secret";
DROP TABLE "Secret";
ALTER TABLE "new_Secret" RENAME TO "Secret";
CREATE UNIQUE INDEX "Secret_id_key" ON "Secret"("id");
CREATE TABLE "new_User" (
"id" TEXT NOT NULL PRIMARY KEY,
"username" TEXT NOT NULL,
"email" TEXT NOT NULL,
"password" TEXT NOT NULL,
"role" TEXT NOT NULL DEFAULT 'user',
"generated" BOOLEAN NOT NULL DEFAULT false,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_User" ("email", "generated", "id", "password", "role", "username") SELECT "email", "generated", "id", "password", "role", "username" FROM "User";
DROP TABLE "User";
ALTER TABLE "new_User" RENAME TO "User";
CREATE UNIQUE INDEX "User_id_key" ON "User"("id");
CREATE UNIQUE INDEX "User_username_key" ON "User"("username");
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
5 changes: 5 additions & 0 deletions src/client/components/settings/secondary-links.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export default function SecondaryLinks() {
const theme = useMantineTheme();

const data = [
{
label: t('public_list'),
icon: <IconList size="1rem" stroke={1.5} />,
route: '/public',
},
{
label: 'Privacy',
icon: <IconFingerprint size="1rem" stroke={1.5} />,
Expand Down

0 comments on commit 8978f08

Please sign in to comment.