fix: lazily import sharp to fix commonjs error
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
CREATE TABLE `performance` (
|
||||
`path` text NOT NULL,
|
||||
`search` text,
|
||||
`time` integer NOT NULL,
|
||||
`created_at` integer DEFAULT (current_timestamp)
|
||||
`path` text NOT NULL,
|
||||
`search` text,
|
||||
`time` integer NOT NULL,
|
||||
`created_at` integer DEFAULT (CURRENT_TIMESTAMP)
|
||||
);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `session` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`created_at` integer DEFAULT (current_timestamp),
|
||||
`expires_at` integer NOT NULL,
|
||||
`user_id` text NOT NULL
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`created_at` integer DEFAULT (CURRENT_TIMESTAMP),
|
||||
`expires_at` integer NOT NULL,
|
||||
`user_id` text NOT NULL
|
||||
);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `user` (
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`created_at` integer DEFAULT (current_timestamp) NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`name` text NOT NULL
|
||||
`id` text PRIMARY KEY NOT NULL,
|
||||
`created_at` integer DEFAULT (CURRENT_TIMESTAMP) NOT NULL,
|
||||
`email` text NOT NULL,
|
||||
`name` text NOT NULL
|
||||
);
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
ALTER TABLE `performance` ALTER COLUMN "created_at" TO "created_at" integer DEFAULT (STRFTIME('%s', 'now') * 1000);
|
||||
ALTER TABLE
|
||||
`performance`
|
||||
ALTER COLUMN
|
||||
"created_at" TO "created_at" integer DEFAULT (STRFTIME('%s', 'now') * 1000);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CREATE TABLE `image` (
|
||||
`created_at` integer DEFAULT (current_timestamp),
|
||||
`url` text NOT NULL,
|
||||
`average` text NOT NULL,
|
||||
`blurhash` text NOT NULL,
|
||||
`mime` text NOT NULL
|
||||
`created_at` integer DEFAULT (CURRENT_TIMESTAMP),
|
||||
`url` text NOT NULL,
|
||||
`average` text NOT NULL,
|
||||
`blurhash` text NOT NULL,
|
||||
`mime` text NOT NULL
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
CREATE TABLE `document` (
|
||||
`name` text NOT NULL,
|
||||
`last_modified` integer NOT NULL,
|
||||
`contentType` text NOT NULL,
|
||||
`size` integer NOT NULL,
|
||||
`perm` text NOT NULL
|
||||
`name` text NOT NULL,
|
||||
`last_modified` integer NOT NULL,
|
||||
`contentType` text NOT NULL,
|
||||
`size` integer NOT NULL,
|
||||
`perm` text NOT NULL
|
||||
);
|
||||
|
||||
@@ -1,13 +1,38 @@
|
||||
PRAGMA foreign_keys=OFF;--> statement-breakpoint
|
||||
CREATE TABLE `__new_document` (
|
||||
`name` text PRIMARY KEY NOT NULL,
|
||||
`last_modified` integer NOT NULL,
|
||||
`contentType` text NOT NULL,
|
||||
`size` integer NOT NULL,
|
||||
`perm` text NOT NULL
|
||||
);
|
||||
PRAGMA foreign_keys = OFF;
|
||||
|
||||
--> statement-breakpoint
|
||||
INSERT INTO `__new_document`("name", "last_modified", "contentType", "size", "perm") SELECT "name", "last_modified", "contentType", "size", "perm" FROM `document`;--> statement-breakpoint
|
||||
DROP TABLE `document`;--> statement-breakpoint
|
||||
ALTER TABLE `__new_document` RENAME TO `document`;--> statement-breakpoint
|
||||
PRAGMA foreign_keys=ON;
|
||||
CREATE TABLE `__new_document` (
|
||||
`name` text PRIMARY KEY NOT NULL,
|
||||
`last_modified` integer NOT NULL,
|
||||
`contentType` text NOT NULL,
|
||||
`size` integer NOT NULL,
|
||||
`perm` text NOT NULL
|
||||
);
|
||||
|
||||
--> statement-breakpoint
|
||||
INSERT INTO
|
||||
`__new_document`(
|
||||
"name",
|
||||
"last_modified",
|
||||
"contentType",
|
||||
"size",
|
||||
"perm"
|
||||
)
|
||||
SELECT
|
||||
"name",
|
||||
"last_modified",
|
||||
"contentType",
|
||||
"size",
|
||||
"perm"
|
||||
FROM
|
||||
`document`;
|
||||
|
||||
--> statement-breakpoint
|
||||
DROP TABLE `document`;
|
||||
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE
|
||||
`__new_document` RENAME TO `document`;
|
||||
|
||||
--> statement-breakpoint
|
||||
PRAGMA foreign_keys = ON;
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
ALTER TABLE `document` RENAME COLUMN "contentType" TO "content_type";
|
||||
ALTER TABLE
|
||||
`document` RENAME COLUMN "contentType" TO "content_type";
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
ALTER TABLE `document` ADD `content` text;
|
||||
ALTER TABLE
|
||||
`document`
|
||||
ADD
|
||||
`content` text;
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
ALTER TABLE `document` ALTER COLUMN "content" TO "content" text NOT NULL;
|
||||
ALTER TABLE
|
||||
`document`
|
||||
ALTER COLUMN
|
||||
"content" TO "content" text NOT NULL;
|
||||
|
||||
@@ -1 +1,4 @@
|
||||
ALTER TABLE `document` ALTER COLUMN "content" TO "content" text;
|
||||
ALTER TABLE
|
||||
`document`
|
||||
ALTER COLUMN
|
||||
"content" TO "content" text;
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
CREATE TABLE `cache` (
|
||||
`scope` text NOT NULL,
|
||||
`key` text PRIMARY KEY NOT NULL,
|
||||
`json` text,
|
||||
`binary` blob,
|
||||
`created_at` integer DEFAULT (current_timestamp),
|
||||
`expires_at` integer
|
||||
`scope` text NOT NULL,
|
||||
`key` text PRIMARY KEY NOT NULL,
|
||||
`json` text,
|
||||
`binary` blob,
|
||||
`created_at` integer DEFAULT (CURRENT_TIMESTAMP),
|
||||
`expires_at` integer
|
||||
);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `key_idx` ON `cache` (`key`);--> statement-breakpoint
|
||||
CREATE INDEX `scope_idx` ON `cache` (`scope`);--> statement-breakpoint
|
||||
CREATE INDEX `name_idx` ON `document` (`name`);
|
||||
CREATE INDEX `key_idx` ON `cache` (`key`);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `scope_idx` ON `cache` (`scope`);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `name_idx` ON `document` (`name`);
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
ALTER TABLE `image` RENAME COLUMN "blurhash" TO "thumbhash";
|
||||
ALTER TABLE
|
||||
`image` RENAME COLUMN "blurhash" TO "thumbhash";
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
DROP INDEX "key_idx";--> statement-breakpoint
|
||||
DROP INDEX "scope_idx";--> statement-breakpoint
|
||||
DROP INDEX "name_idx";--> statement-breakpoint
|
||||
ALTER TABLE `image` ALTER COLUMN "created_at" TO "created_at" integer DEFAULT (unixepoch());--> statement-breakpoint
|
||||
CREATE INDEX `key_idx` ON `cache` (`key`);--> statement-breakpoint
|
||||
CREATE INDEX `scope_idx` ON `cache` (`scope`);--> statement-breakpoint
|
||||
DROP INDEX "key_idx";
|
||||
|
||||
--> statement-breakpoint
|
||||
DROP INDEX "scope_idx";
|
||||
|
||||
--> statement-breakpoint
|
||||
DROP INDEX "name_idx";
|
||||
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE
|
||||
`image`
|
||||
ALTER COLUMN
|
||||
"created_at" TO "created_at" integer DEFAULT (unixepoch());
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `key_idx` ON `cache` (`key`);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `scope_idx` ON `cache` (`scope`);
|
||||
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `name_idx` ON `document` (`name`);
|
||||
|
||||
@@ -306,4 +306,4 @@
|
||||
"internal": {
|
||||
"indexes": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,4 +87,4 @@
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user