tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
288
fork
atom
a tool for shared writing and social publishing
288
fork
atom
overview
issues
27
pulls
pipelines
add interface_state to identity table
awarm.space
5 months ago
254b4811
d9eb7b27
+9
-1
4 changed files
expand all
collapse all
unified
split
actions
createIdentity.ts
drizzle
schema.ts
supabase
database.types.ts
migrations
20250922052532_add_interface_state_col_to_identity_table.sql
+4
-1
actions/createIdentity.ts
···
8
8
import { v7 } from "uuid";
9
9
import { PgTransaction } from "drizzle-orm/pg-core";
10
10
import { NodePgDatabase } from "drizzle-orm/node-postgres";
11
11
+
import { Json } from "supabase/database.types";
11
12
12
13
export async function createIdentity(
13
14
db: NodePgDatabase,
···
43
44
.insert(identities)
44
45
.values({ home_page: permissionToken.id, ...data })
45
46
.returning();
46
46
-
return identity;
47
47
+
return identity as Omit<typeof identity, "interface_state"> & {
48
48
+
interface_state: Json;
49
49
+
};
47
50
});
48
51
}
+1
drizzle/schema.ts
···
101
101
home_page: uuid("home_page").notNull().references(() => permission_tokens.id, { onDelete: "cascade" } ),
102
102
email: text("email"),
103
103
atp_did: text("atp_did"),
104
104
+
interface_state: jsonb("interface_state"),
104
105
},
105
106
(table) => {
106
107
return {
+3
supabase/database.types.ts
···
461
461
email: string | null
462
462
home_page: string
463
463
id: string
464
464
+
interface_state: Json | null
464
465
}
465
466
Insert: {
466
467
atp_did?: string | null
···
468
469
email?: string | null
469
470
home_page: string
470
471
id?: string
472
472
+
interface_state?: Json | null
471
473
}
472
474
Update: {
473
475
atp_did?: string | null
···
475
477
email?: string | null
476
478
home_page?: string
477
479
id?: string
480
480
+
interface_state?: Json | null
478
481
}
479
482
Relationships: [
480
483
{
+1
supabase/migrations/20250922052532_add_interface_state_col_to_identity_table.sql
···
1
1
+
alter table "public"."identities" add column "interface_state" jsonb;