@conorroberts/utils 0.0.97 → 0.0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/db/migrate.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
1
2
|
import { consola } from "consola";
|
|
2
3
|
import { drizzle } from "drizzle-orm/planetscale-serverless";
|
|
3
4
|
import { migrate } from "drizzle-orm/planetscale-serverless/migrator";
|
|
@@ -9,7 +10,7 @@ const runMigration = async (options) => {
|
|
|
9
10
|
host: options.host,
|
|
10
11
|
username: options.username,
|
|
11
12
|
password: options.password
|
|
12
|
-
} }), { migrationsFolder: options.migrationsFolder });
|
|
13
|
+
} }), { migrationsFolder: resolve(options.migrationsFolder) });
|
|
13
14
|
consola.log("[OK] Migrations completed successfully!");
|
|
14
15
|
};
|
|
15
16
|
|
package/dist/db/migrate.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.mjs","names":[],"sources":["../../src/db/migrate.ts"],"sourcesContent":["import { consola } from \"consola\";\r\nimport { drizzle } from \"drizzle-orm/planetscale-serverless\";\r\nimport { migrate } from \"drizzle-orm/planetscale-serverless/migrator\";\r\n\r\ninterface MigrateOptions {\r\n migrationsFolder: string;\r\n host: string;\r\n username: string;\r\n password: string;\r\n}\r\n\r\nconst runMigration = async (options: MigrateOptions) => {\r\n consola.log(\"Running database migrations...\");\r\n\r\n const db = drizzle({\r\n connection: {\r\n host: options.host,\r\n username: options.username,\r\n password: options.password,\r\n },\r\n });\r\n\r\n await migrate(db, { migrationsFolder: options.migrationsFolder });\r\n consola.log(\"[OK] Migrations completed successfully!\");\r\n};\r\n\r\nexport { runMigration };\r\nexport type { MigrateOptions };\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate.mjs","names":[],"sources":["../../src/db/migrate.ts"],"sourcesContent":["import { resolve } from \"node:path\";\r\nimport { consola } from \"consola\";\r\nimport { drizzle } from \"drizzle-orm/planetscale-serverless\";\r\nimport { migrate } from \"drizzle-orm/planetscale-serverless/migrator\";\r\n\r\ninterface MigrateOptions {\r\n migrationsFolder: string;\r\n host: string;\r\n username: string;\r\n password: string;\r\n}\r\n\r\nconst runMigration = async (options: MigrateOptions) => {\r\n consola.log(\"Running database migrations...\");\r\n\r\n const db = drizzle({\r\n connection: {\r\n host: options.host,\r\n username: options.username,\r\n password: options.password,\r\n },\r\n });\r\n\r\n await migrate(db, { migrationsFolder: resolve(options.migrationsFolder) });\r\n consola.log(\"[OK] Migrations completed successfully!\");\r\n};\r\n\r\nexport { runMigration };\r\nexport type { MigrateOptions };\r\n"],"mappings":";;;;;;AAYA,MAAM,eAAe,OAAO,YAA4B;AACtD,SAAQ,IAAI,iCAAiC;AAU7C,OAAM,QARK,QAAQ,EACjB,YAAY;EACV,MAAM,QAAQ;EACd,UAAU,QAAQ;EAClB,UAAU,QAAQ;EACnB,EACF,CAAC,EAEgB,EAAE,kBAAkB,QAAQ,QAAQ,iBAAiB,EAAE,CAAC;AAC1E,SAAQ,IAAI,0CAA0C"}
|