Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f34fd644b8
|
||
|
|
c827c2e58d
|
2
backend/.migrations/0009_add_privacy_settings.sql
Normal file
2
backend/.migrations/0009_add_privacy_settings.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE "users" ADD COLUMN "show_online_status" boolean DEFAULT true NOT NULL;--> statement-breakpoint
|
||||||
|
ALTER TABLE "users" ADD COLUMN "show_read_receipts" boolean DEFAULT true NOT NULL;
|
||||||
1
backend/.migrations/0010_update_password_hash_length.sql
Normal file
1
backend/.migrations/0010_update_password_hash_length.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "users" ALTER COLUMN "password_hash" SET DATA TYPE varchar(255);
|
||||||
2094
backend/.migrations/meta/0009_snapshot.json
Normal file
2094
backend/.migrations/meta/0009_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
2094
backend/.migrations/meta/0010_snapshot.json
Normal file
2094
backend/.migrations/meta/0010_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -64,6 +64,20 @@
|
|||||||
"when": 1769696731978,
|
"when": 1769696731978,
|
||||||
"tag": "0008_bitter_darwin",
|
"tag": "0008_bitter_darwin",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 9,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1769717126917,
|
||||||
|
"tag": "0009_add_privacy_settings",
|
||||||
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 10,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1769718997591,
|
||||||
|
"tag": "0010_update_password_hash_length",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@memegoat/backend",
|
"name": "@memegoat/backend",
|
||||||
"version": "1.9.4",
|
"version": "1.9.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -21,14 +21,19 @@ const getPgpKey = () => process.env.PGP_ENCRYPTION_KEY || "default-pgp-key";
|
|||||||
* withAutomaticPgpDecrypt(users.email);
|
* withAutomaticPgpDecrypt(users.email);
|
||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
export const pgpEncrypted = customType<{ data: string; driverData: Buffer }>({
|
export const pgpEncrypted = customType<{
|
||||||
|
data: string | null;
|
||||||
|
driverData: Buffer | string | null | SQL;
|
||||||
|
}>({
|
||||||
dataType() {
|
dataType() {
|
||||||
return "bytea";
|
return "bytea";
|
||||||
},
|
},
|
||||||
toDriver(value: string): SQL {
|
toDriver(value: string | null): SQL | null {
|
||||||
|
if (value === null) return null;
|
||||||
return sql`pgp_sym_encrypt(${value}, ${getPgpKey()})`;
|
return sql`pgp_sym_encrypt(${value}, ${getPgpKey()})`;
|
||||||
},
|
},
|
||||||
fromDriver(value: Buffer | string): string {
|
fromDriver(value: Buffer | string | null | any): string | null {
|
||||||
|
if (value === null || value === undefined) return null;
|
||||||
if (typeof value === "string") return value;
|
if (typeof value === "string") return value;
|
||||||
return value.toString();
|
return value.toString();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const users = pgTable(
|
|||||||
displayName: varchar("display_name", { length: 32 }),
|
displayName: varchar("display_name", { length: 32 }),
|
||||||
|
|
||||||
username: varchar("username", { length: 32 }).notNull().unique(),
|
username: varchar("username", { length: 32 }).notNull().unique(),
|
||||||
passwordHash: varchar("password_hash", { length: 100 }).notNull(),
|
passwordHash: varchar("password_hash", { length: 255 }).notNull(),
|
||||||
avatarUrl: varchar("avatar_url", { length: 512 }),
|
avatarUrl: varchar("avatar_url", { length: 512 }),
|
||||||
bio: varchar("bio", { length: 255 }),
|
bio: varchar("bio", { length: 255 }),
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@memegoat/frontend",
|
"name": "@memegoat/frontend",
|
||||||
"version": "1.9.4",
|
"version": "1.9.5",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@memegoat/source",
|
"name": "@memegoat/source",
|
||||||
"version": "1.9.4",
|
"version": "1.9.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"version:get": "cmake -P version.cmake GET",
|
"version:get": "cmake -P version.cmake GET",
|
||||||
|
|||||||
Reference in New Issue
Block a user