Skip to content

Commit

Permalink
Merge pull request #46 from gov4git/cache-layer
Browse files Browse the repository at this point in the history
Improve cache layer
  • Loading branch information
dworthen committed Nov 28, 2023
2 parents da6070a + e2b17d2 commit 26a6ca7
Show file tree
Hide file tree
Showing 54 changed files with 2,114 additions and 992 deletions.
7 changes: 7 additions & 0 deletions .changeset/thin-deers-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'gov4git-desktop-app': minor
---

Improve cache layer

- Cache user, communities, and settings
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"envFile": "${workspaceFolder}/.env",
"args": [
".",
"--remote-debugging-port=9222"
Expand Down
32 changes: 32 additions & 0 deletions migrations/0002_marvelous_zemo.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
CREATE TABLE `communities` (
`url` text PRIMARY KEY NOT NULL,
`branch` text NOT NULL,
`name` text NOT NULL,
`configPath` text NOT NULL,
`projectUrl` text NOT NULL,
`selected` integer NOT NULL
);
--> statement-breakpoint
CREATE TABLE `userCommunities` (
`id` integer PRIMARY KEY NOT NULL,
`userId` text NOT NULL,
`communityId` text NOT NULL,
`isMember` integer NOT NULL,
`isMaintainer` integer NOT NULL,
`votingCredits` real NOT NULL,
`votingScore` real NOT NULL,
FOREIGN KEY (`userId`) REFERENCES `users`(`username`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`communityId`) REFERENCES `communities`(`url`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `users` (
`username` text PRIMARY KEY NOT NULL,
`pat` text NOT NULL,
`memberPublicUrl` text NOT NULL,
`memberPublicBranch` text NOT NULL,
`memberPrivateUrl` text NOT NULL,
`memberPrivateBranch` text NOT NULL
);
--> statement-breakpoint
ALTER TABLE ballots ADD `status` text DEFAULT 'open' NOT NULL;--> statement-breakpoint
CREATE UNIQUE INDEX `userCommunities_communityId_unique` ON `userCommunities` (`communityId`);
Loading

0 comments on commit 26a6ca7

Please sign in to comment.