peta-migrate 0.2.1 → 0.2.2

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/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createMigrationGenerator, c as loadConfig, d as computeChecksum, f as loadChecksums, i as createMigrationRunner, l as loadMigrationFiles, m as verifyChecksum, n as loadSnapshot, o as diffSnapshots, p as saveChecksums, r as saveSnapshot, t as createSnapshot, u as loadModels } from "./snapshot-DopEB8mx.mjs";
1
+ import { a as createMigrationGenerator, c as loadConfig, d as computeChecksum, f as loadChecksums, i as createMigrationRunner, l as loadMigrationFiles, m as verifyChecksum, n as loadSnapshot, o as diffSnapshots, p as saveChecksums, r as saveSnapshot, t as createSnapshot, u as loadModels } from "./snapshot-CO180dF3.mjs";
2
2
  import { mkdirSync, writeFileSync } from "node:fs";
3
3
  import { resolve } from "node:path";
4
4
  import cac from "cac";
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as pushSchema } from "./pusher-Be3BYUQM.mjs";
2
- import { a as createMigrationGenerator, c as loadConfig, d as computeChecksum, f as loadChecksums, i as createMigrationRunner, l as loadMigrationFiles, m as verifyChecksum, n as loadSnapshot, o as diffSnapshots, p as saveChecksums, r as saveSnapshot, s as defineConfig, t as createSnapshot, u as loadModels } from "./snapshot-DopEB8mx.mjs";
2
+ import { a as createMigrationGenerator, c as loadConfig, d as computeChecksum, f as loadChecksums, i as createMigrationRunner, l as loadMigrationFiles, m as verifyChecksum, n as loadSnapshot, o as diffSnapshots, p as saveChecksums, r as saveSnapshot, s as defineConfig, t as createSnapshot, u as loadModels } from "./snapshot-CO180dF3.mjs";
3
3
  export { computeChecksum, createMigrationGenerator, createMigrationRunner, createSnapshot, defineConfig, diffSnapshots, loadChecksums, loadConfig, loadMigrationFiles, loadModels, loadSnapshot, pushSchema, saveChecksums, saveSnapshot, verifyChecksum };
@@ -411,11 +411,7 @@ function createMigrationRunner(db, table = "_peta_migrations") {
411
411
  }
412
412
  }
413
413
  async function ensureTable() {
414
- const result = await buildMigrator([]).migrateUp();
415
- if (result.error) {
416
- const msg = result.error.message ?? "";
417
- if (!msg.includes("no migrations") && !msg.includes("no pending")) throw result.error;
418
- }
414
+ await db.schema.createTable(table).addColumn("name", "varchar(255)", (cb) => cb.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (cb) => cb.notNull()).ifNotExists().execute();
419
415
  }
420
416
  async function getCompleted() {
421
417
  return queryCompleted();
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "peta-migrate",
3
3
  "type": "module",
4
4
  "private": false,
5
- "version": "0.2.1",
5
+ "version": "0.2.2",
6
6
  "description": "Migration tools for peta-orm",
7
7
  "license": "MIT",
8
8
  "repository": {