Added user tab and oauth2, streamlined readme

This commit is contained in:
fuomag9
2025-12-28 15:14:56 +01:00
parent f8a673cc03
commit be21f46ad5
28 changed files with 3213 additions and 245 deletions

View File

@@ -0,0 +1,8 @@
CREATE TABLE `pending_oauth_links` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` integer NOT NULL,
`provider` text NOT NULL,
`created_at` text NOT NULL,
`expires_at` text NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);

View File

@@ -0,0 +1,14 @@
-- Drop existing pending OAuth links (they're temporary with 5-minute expiry anyway)
DROP TABLE IF EXISTS `pending_oauth_links`;--> statement-breakpoint
-- Create new table with userEmail column and unique index
CREATE TABLE `pending_oauth_links` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`user_id` integer NOT NULL,
`provider` text(50) NOT NULL,
`user_email` text NOT NULL,
`created_at` text NOT NULL,
`expires_at` text NOT NULL,
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `pending_oauth_user_provider_unique` ON `pending_oauth_links` (`user_id`,`provider`);

View File

@@ -1,8 +1,8 @@
{
"version": "6",
"dialect": "sqlite",
"id": "b14592c5-88b2-43bd-910e-bd39d63b6923",
"prevId": "00000000-0000-0000-0000-000000000000",
"id": "27881e49-47c6-4fe5-898d-a4f095273605",
"prevId": "b14592c5-88b2-43bd-910e-bd39d63b6923",
"tables": {
"access_list_entries": {
"name": "access_list_entries",
@@ -556,6 +556,65 @@
"uniqueConstraints": {},
"checkConstraints": {}
},
"pending_oauth_links": {
"name": "pending_oauth_links",
"columns": {
"id": {
"name": "id",
"type": "integer",
"primaryKey": true,
"notNull": true,
"autoincrement": true
},
"user_id": {
"name": "user_id",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"created_at": {
"name": "created_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"expires_at": {
"name": "expires_at",
"type": "text",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {
"pending_oauth_links_user_id_users_id_fk": {
"name": "pending_oauth_links_user_id_users_id_fk",
"tableFrom": "pending_oauth_links",
"tableTo": "users",
"columnsFrom": [
"user_id"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraints": {}
},
"proxy_hosts": {
"name": "proxy_hosts",
"columns": {

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,20 @@
"when": 1762515724134,
"tag": "0000_initial",
"breakpoints": true
},
{
"idx": 1,
"version": "6",
"when": 1766854292252,
"tag": "0001_adorable_sally_floyd",
"breakpoints": true
},
{
"idx": 2,
"version": "6",
"when": 1766880443160,
"tag": "0002_perfect_hedge_knight",
"breakpoints": true
}
]
}
}