aboutsummaryrefslogtreecommitdiff
path: root/apps/web/migrations
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-06-30 20:50:24 -0500
committerDhravya <[email protected]>2024-06-30 20:50:24 -0500
commitffd141ade4e6074ee486da7f74f31e3905807cb9 (patch)
tree505d73b0a7c04cdec93d7f5be88c635642716c15 /apps/web/migrations
parentshow updates in the extension (diff)
parentMerge pull request #93 from Dhravya/editor (diff)
downloadsupermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.tar.xz
supermemory-ffd141ade4e6074ee486da7f74f31e3905807cb9.zip
merge conflicts
Diffstat (limited to 'apps/web/migrations')
-rw-r--r--apps/web/migrations/0000_bitter_electro.sql (renamed from apps/web/migrations/000_setup.sql)18
-rw-r--r--apps/web/migrations/meta/0000_snapshot.json75
-rw-r--r--apps/web/migrations/meta/_journal.json20
3 files changed, 86 insertions, 27 deletions
diff --git a/apps/web/migrations/000_setup.sql b/apps/web/migrations/0000_bitter_electro.sql
index a4855ec9..3ce840e7 100644
--- a/apps/web/migrations/000_setup.sql
+++ b/apps/web/migrations/0000_bitter_electro.sql
@@ -27,6 +27,15 @@ CREATE TABLE `authenticator` (
FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
+CREATE TABLE `canvas` (
+ `id` text PRIMARY KEY NOT NULL,
+ `title` text DEFAULT 'Untitled' NOT NULL,
+ `description` text DEFAULT 'Untitled' NOT NULL,
+ `url` text DEFAULT '' NOT NULL,
+ `userId` text NOT NULL,
+ FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade
+);
+--> statement-breakpoint
CREATE TABLE `chatHistory` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`threadId` text NOT NULL,
@@ -86,7 +95,8 @@ CREATE TABLE `user` (
`name` text,
`email` text NOT NULL,
`emailVerified` integer,
- `image` text
+ `image` text,
+ `telegramId` text
);
--> statement-breakpoint
CREATE TABLE `verificationToken` (
@@ -97,6 +107,7 @@ CREATE TABLE `verificationToken` (
);
--> statement-breakpoint
CREATE UNIQUE INDEX `authenticator_credentialID_unique` ON `authenticator` (`credentialID`);--> statement-breakpoint
+CREATE INDEX `canvas_user_userId` ON `canvas` (`userId`);--> statement-breakpoint
CREATE INDEX `chatHistory_thread_idx` ON `chatHistory` (`threadId`);--> statement-breakpoint
CREATE INDEX `chatThread_user_idx` ON `chatThread` (`userId`);--> statement-breakpoint
CREATE UNIQUE INDEX `space_name_unique` ON `space` (`name`);--> statement-breakpoint
@@ -105,4 +116,7 @@ CREATE INDEX `spaces_user_idx` ON `space` (`user`);--> statement-breakpoint
CREATE INDEX `storedContent_url_idx` ON `storedContent` (`url`);--> statement-breakpoint
CREATE INDEX `storedContent_savedAt_idx` ON `storedContent` (`savedAt`);--> statement-breakpoint
CREATE INDEX `storedContent_title_idx` ON `storedContent` (`title`);--> statement-breakpoint
-CREATE INDEX `storedContent_user_idx` ON `storedContent` (`user`);
+CREATE INDEX `storedContent_user_idx` ON `storedContent` (`user`);--> statement-breakpoint
+CREATE INDEX `users_email_idx` ON `user` (`email`);--> statement-breakpoint
+CREATE INDEX `users_telegram_idx` ON `user` (`telegramId`);--> statement-breakpoint
+CREATE INDEX `users_id_idx` ON `user` (`id`); \ No newline at end of file
diff --git a/apps/web/migrations/meta/0000_snapshot.json b/apps/web/migrations/meta/0000_snapshot.json
index 291848ad..92a05c00 100644
--- a/apps/web/migrations/meta/0000_snapshot.json
+++ b/apps/web/migrations/meta/0000_snapshot.json
@@ -1,7 +1,7 @@
{
"version": "6",
"dialect": "sqlite",
- "id": "6988522d-8117-484d-b52a-94c0fbd75140",
+ "id": "58ec8bd8-5aad-4ade-a718-74eaf6056d36",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"account": {
@@ -191,6 +191,69 @@
},
"uniqueConstraints": {}
},
+ "canvas": {
+ "name": "canvas",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'Untitled'"
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "'Untitled'"
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false,
+ "default": "''"
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ }
+ },
+ "indexes": {
+ "canvas_user_userId": {
+ "name": "canvas_user_userId",
+ "columns": ["userId"],
+ "isUnique": false
+ }
+ },
+ "foreignKeys": {
+ "canvas_userId_user_id_fk": {
+ "name": "canvas_userId_user_id_fk",
+ "tableFrom": "canvas",
+ "tableTo": "user",
+ "columnsFrom": ["userId"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {}
+ },
"chatHistory": {
"name": "chatHistory",
"columns": {
@@ -415,13 +478,6 @@
"primaryKey": false,
"notNull": false,
"autoincrement": false
- },
- "createdAt": {
- "name": "createdAt",
- "type": "integer",
- "primaryKey": false,
- "notNull": true,
- "autoincrement": false
}
},
"indexes": {
@@ -681,5 +737,8 @@
"schemas": {},
"tables": {},
"columns": {}
+ },
+ "internal": {
+ "indexes": {}
}
}
diff --git a/apps/web/migrations/meta/_journal.json b/apps/web/migrations/meta/_journal.json
index 6231765b..b628749f 100644
--- a/apps/web/migrations/meta/_journal.json
+++ b/apps/web/migrations/meta/_journal.json
@@ -1,26 +1,12 @@
{
- "version": "6",
+ "version": "7",
"dialect": "sqlite",
"entries": [
{
"idx": 0,
"version": "6",
- "when": 1719671614406,
- "tag": "0000_classy_speed_demon",
- "breakpoints": true
- },
- {
- "idx": 1,
- "version": "6",
- "when": 1719772835765,
- "tag": "0001_chubby_vulture",
- "breakpoints": true
- },
- {
- "idx": 2,
- "version": "6",
- "when": 1719789157348,
- "tag": "0002_old_titanium_man",
+ "when": 1719619409551,
+ "tag": "0000_bitter_electro",
"breakpoints": true
}
]