You've already forked obsidian-visualiser
Fix login, registration and made the first database version.
This commit is contained in:
36
drizzle/0000_needy_rictor.sql
Normal file
36
drizzle/0000_needy_rictor.sql
Normal file
@@ -0,0 +1,36 @@
|
||||
CREATE TABLE `explorer_content` (
|
||||
`path` text PRIMARY KEY NOT NULL,
|
||||
`owner` integer NOT NULL,
|
||||
`title` text NOT NULL,
|
||||
`type` text NOT NULL,
|
||||
`content` blob,
|
||||
`navigable` integer DEFAULT true,
|
||||
`private` integer DEFAULT false,
|
||||
FOREIGN KEY (`owner`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `user_sessions` (
|
||||
`id` integer NOT NULL,
|
||||
`user_id` integer NOT NULL,
|
||||
`timestamp` integer NOT NULL,
|
||||
PRIMARY KEY(`id`, `user_id`),
|
||||
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `users_data` (
|
||||
`id` integer PRIMARY KEY NOT NULL,
|
||||
`signin` integer NOT NULL,
|
||||
FOREIGN KEY (`id`) REFERENCES `users`(`id`) ON UPDATE cascade ON DELETE cascade
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `users` (
|
||||
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`username` text NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`hash` text NOT NULL,
|
||||
`state` integer DEFAULT 0 NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `users_username_unique` ON `users` (`username`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `users_email_unique` ON `users` (`email`);--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX `users_hash_unique` ON `users` (`hash`);
|
||||
Reference in New Issue
Block a user