Skip to content

Commit

Permalink
ok, got something done
Browse files Browse the repository at this point in the history
  • Loading branch information
d3rpp committed Nov 7, 2024
1 parent f0b68c5 commit a0be2f9
Show file tree
Hide file tree
Showing 36 changed files with 849 additions and 1,023 deletions.
Binary file modified bun.lockb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CREATE TABLE `email_addresses` (
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `email_addresses_email_address_unique` ON `email_addresses` (`email_address`);--> statement-breakpoint
CREATE TABLE `encrypted_blobs` (
`kid` text PRIMARY KEY NOT NULL,
`iv` blob NOT NULL,
Expand All @@ -17,15 +18,10 @@ CREATE TABLE `oauth_connections` (
`type` text NOT NULL,
`oauth_identifier` text NOT NULL,
`user_id` text NOT NULL,
`connection_user_name` text NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `passwords` (
`user_id` text PRIMARY KEY NOT NULL,
`password_hash` text NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `public_assets` (
`file_name` text PRIMARY KEY NOT NULL,
`type` text NOT NULL,
Expand All @@ -34,11 +30,19 @@ CREATE TABLE `public_assets` (
--> statement-breakpoint
CREATE TABLE `public_keys` (
`kid` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`key` blob NOT NULL,
`key_owner` text NOT NULL,
FOREIGN KEY (`key_owner`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `public_keys_key_unique` ON `public_keys` (`key`);--> statement-breakpoint
CREATE TABLE `reserved_kids` (
`kid` text PRIMARY KEY NOT NULL,
`user` text NOT NULL,
FOREIGN KEY (`user`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE TABLE `sessions` (
`id` text NOT NULL,
`user_id` text NOT NULL,
Expand All @@ -57,6 +61,7 @@ CREATE TABLE `user_aliases` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_ref` text NOT NULL,
`alias_name` text NOT NULL,
`alias_timestamp` integer NOT NULL,
FOREIGN KEY (`user_ref`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
Expand All @@ -68,6 +73,4 @@ CREATE TABLE `users` (
FOREIGN KEY (`profile_picture`) REFERENCES `public_assets`(`file_name`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE UNIQUE INDEX `email_addresses_email_address_unique` ON `email_addresses` (`email_address`);--> statement-breakpoint
CREATE UNIQUE INDEX `public_keys_key_unique` ON `public_keys` (`key`);--> statement-breakpoint
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);
1 change: 0 additions & 1 deletion drizzle/0001_noisy_lady_deathstrike.sql

This file was deleted.

116 changes: 74 additions & 42 deletions drizzle/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
"id": "818c640b-29b0-4c20-8eb8-191759e45ae4",
"id": "50492699-bfc7-4f37-ac2f-b2bdb3cb7e8d",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"email_addresses": {
Expand Down Expand Up @@ -56,7 +56,8 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"encrypted_blobs": {
"name": "encrypted_blobs",
Expand Down Expand Up @@ -96,7 +97,8 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"oauth_connections": {
"name": "oauth_connections",
Expand All @@ -121,35 +123,9 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"oauth_connections_user_id_users_id_fk": {
"name": "oauth_connections_user_id_users_id_fk",
"tableFrom": "oauth_connections",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
},
"passwords": {
"name": "passwords",
"columns": {
"user_id": {
"name": "user_id",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"password_hash": {
"name": "password_hash",
"connection_user_name": {
"name": "connection_user_name",
"type": "text",
"primaryKey": false,
"notNull": true,
Expand All @@ -158,18 +134,19 @@
},
"indexes": {},
"foreignKeys": {
"passwords_user_id_users_id_fk": {
"name": "passwords_user_id_users_id_fk",
"tableFrom": "passwords",
"oauth_connections_user_id_users_id_fk": {
"name": "oauth_connections_user_id_users_id_fk",
"tableFrom": "oauth_connections",
"tableTo": "users",
"columnsFrom": ["user_id"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onDelete": "no action",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"public_assets": {
"name": "public_assets",
Expand Down Expand Up @@ -199,7 +176,8 @@
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"public_keys": {
"name": "public_keys",
Expand All @@ -211,6 +189,13 @@
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"key": {
"name": "key",
"type": "blob",
Expand Down Expand Up @@ -245,7 +230,42 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"reserved_kids": {
"name": "reserved_kids",
"columns": {
"kid": {
"name": "kid",
"type": "text",
"primaryKey": true,
"notNull": true,
"autoincrement": false
},
"user": {
"name": "user",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"reserved_kids_user_users_id_fk": {
"name": "reserved_kids_user_users_id_fk",
"tableFrom": "reserved_kids",
"tableTo": "users",
"columnsFrom": ["user"],
"columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"sessions": {
"name": "sessions",
Expand Down Expand Up @@ -285,7 +305,8 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"symmetric_keys": {
"name": "symmetric_keys",
Expand Down Expand Up @@ -325,7 +346,8 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"user_aliases": {
"name": "user_aliases",
Expand All @@ -350,6 +372,13 @@
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"alias_timestamp": {
"name": "alias_timestamp",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
Expand All @@ -365,7 +394,8 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
},
"users": {
"name": "users",
Expand Down Expand Up @@ -418,9 +448,11 @@
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {}
"uniqueConstraints": {},
"checkConstraints": {}
}
},
"views": {},
"enums": {},
"_meta": {
"schemas": {},
Expand Down
Loading

0 comments on commit a0be2f9

Please sign in to comment.