* refactor: improve user feedback for general board settings section * wip: add board settings for background and colors, move danger zone to own file, refactor code * feat: add shade selector * feat: add slider for opacity * fix: issue with invalid hex values for color preview * refactor: add shared mutation hook for saving partial board settings with invalidate query * fix: add cleanup for not applied changes to logo and page title * feat: add layout settings * feat: add empty custom css section to board settings * refactor: improve layout of board logo on mobile * feat: add theme provider for board colors * refactor: add auto contrast for better contrast of buttons with low primary shade * feat: add background for boards * feat: add opacity for boards * feat: add rename board * feat: add visibility and delete of board settings * fix: issue that wrong data is updated with update board method * refactor: improve danger zone button placement for mobile * fix: board not revalidated when already in boards layout * refactor: improve board color preview * refactor: change save button color to teal, add placeholders for general board settings * chore: update initial migration * refactor: remove unnecessary div * chore: address pull request feedback * fix: ci issues * fix: deepsource issues * chore: address pull request feedback * fix: formatting issue * chore: address pull request feedback
110 lines
3.6 KiB
SQL
110 lines
3.6 KiB
SQL
CREATE TABLE `account` (
|
|
`userId` text NOT NULL,
|
|
`type` text NOT NULL,
|
|
`provider` text NOT NULL,
|
|
`providerAccountId` text NOT NULL,
|
|
`refresh_token` text,
|
|
`access_token` text,
|
|
`expires_at` integer,
|
|
`token_type` text,
|
|
`scope` text,
|
|
`id_token` text,
|
|
`session_state` text,
|
|
PRIMARY KEY(`provider`, `providerAccountId`),
|
|
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `board` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`name` text NOT NULL,
|
|
`is_public` integer DEFAULT false NOT NULL,
|
|
`page_title` text,
|
|
`meta_title` text,
|
|
`logo_image_url` text,
|
|
`favicon_image_url` text,
|
|
`background_image_url` text,
|
|
`background_image_attachment` text DEFAULT 'fixed' NOT NULL,
|
|
`background_image_repeat` text DEFAULT 'no-repeat' NOT NULL,
|
|
`background_image_size` text DEFAULT 'cover' NOT NULL,
|
|
`primary_color` text DEFAULT '#fa5252' NOT NULL,
|
|
`secondary_color` text DEFAULT '#fd7e14' NOT NULL,
|
|
`opacity` integer DEFAULT 100 NOT NULL,
|
|
`custom_css` text,
|
|
`column_count` integer DEFAULT 10 NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `integration_item` (
|
|
`item_id` text NOT NULL,
|
|
`integration_id` text NOT NULL,
|
|
PRIMARY KEY(`integration_id`, `item_id`),
|
|
FOREIGN KEY (`item_id`) REFERENCES `item`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
FOREIGN KEY (`integration_id`) REFERENCES `integration`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `integrationSecret` (
|
|
`kind` text NOT NULL,
|
|
`value` text NOT NULL,
|
|
`updated_at` integer NOT NULL,
|
|
`integration_id` text NOT NULL,
|
|
PRIMARY KEY(`integration_id`, `kind`),
|
|
FOREIGN KEY (`integration_id`) REFERENCES `integration`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `integration` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`name` text NOT NULL,
|
|
`url` text NOT NULL,
|
|
`kind` text NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `item` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`section_id` text NOT NULL,
|
|
`kind` text NOT NULL,
|
|
`x_offset` integer NOT NULL,
|
|
`y_offset` integer NOT NULL,
|
|
`width` integer NOT NULL,
|
|
`height` integer NOT NULL,
|
|
`options` text DEFAULT '{"json": {}}' NOT NULL,
|
|
FOREIGN KEY (`section_id`) REFERENCES `section`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `section` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`board_id` text NOT NULL,
|
|
`kind` text NOT NULL,
|
|
`position` integer NOT NULL,
|
|
`name` text,
|
|
FOREIGN KEY (`board_id`) REFERENCES `board`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `session` (
|
|
`sessionToken` text PRIMARY KEY NOT NULL,
|
|
`userId` text NOT NULL,
|
|
`expires` integer NOT NULL,
|
|
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `user` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`name` text,
|
|
`email` text,
|
|
`emailVerified` integer,
|
|
`image` text,
|
|
`password` text,
|
|
`salt` text
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `verificationToken` (
|
|
`identifier` text NOT NULL,
|
|
`token` text NOT NULL,
|
|
`expires` integer NOT NULL,
|
|
PRIMARY KEY(`identifier`, `token`)
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `userId_idx` ON `account` (`userId`);--> statement-breakpoint
|
|
CREATE UNIQUE INDEX `board_name_unique` ON `board` (`name`);--> statement-breakpoint
|
|
CREATE INDEX `integration_secret__kind_idx` ON `integrationSecret` (`kind`);--> statement-breakpoint
|
|
CREATE INDEX `integration_secret__updated_at_idx` ON `integrationSecret` (`updated_at`);--> statement-breakpoint
|
|
CREATE INDEX `integration__kind_idx` ON `integration` (`kind`);--> statement-breakpoint
|
|
CREATE INDEX `user_id_idx` ON `session` (`userId`); |