drizzle-kit 0.24.2-30e7661 → 0.24.2-56454b7

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.mts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { ConnectionOptions } from 'tls';
2
2
 
3
- declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
- type Prefix = (typeof prefixes)[number];
5
3
  declare const drivers: readonly ["turso", "d1-http", "expo", "aws-data-api", "pglite"];
6
4
  type Driver = (typeof drivers)[number];
7
5
 
@@ -122,7 +120,6 @@ type Config = {
122
120
  migrations?: {
123
121
  table?: string;
124
122
  schema?: string;
125
- prefix?: Prefix;
126
123
  };
127
124
  introspect?: {
128
125
  casing: 'camel' | 'preserve';
package/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import { ConnectionOptions } from 'tls';
2
2
 
3
- declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
- type Prefix = (typeof prefixes)[number];
5
3
  declare const drivers: readonly ["turso", "d1-http", "expo", "aws-data-api", "pglite"];
6
4
  type Driver = (typeof drivers)[number];
7
5
 
@@ -122,7 +120,6 @@ type Config = {
122
120
  migrations?: {
123
121
  table?: string;
124
122
  schema?: string;
125
- prefix?: Prefix;
126
123
  };
127
124
  introspect?: {
128
125
  casing: 'camel' | 'preserve';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.24.2-30e7661",
3
+ "version": "0.24.2-56454b7",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -39,6 +39,7 @@
39
39
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
40
40
  "pack": "cp package.json README.md dist/ && (cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz",
41
41
  "tsc": "tsc -p tsconfig.build.json",
42
+ "types": "tsc --noEmit",
42
43
  "publish": "npm publish package.tgz"
43
44
  },
44
45
  "dependencies": {
package/utils.js CHANGED
@@ -564,10 +564,9 @@ var require_hanji = __commonJS({
564
564
  // src/utils.ts
565
565
  var utils_exports = {};
566
566
  __export(utils_exports, {
567
- assertV1OutFolder: () => assertV1OutFolder,
567
+ assertV3OutFolder: () => assertV3OutFolder,
568
568
  columnRenameKey: () => columnRenameKey,
569
569
  copy: () => copy,
570
- dryJournal: () => dryJournal,
571
570
  isPgArrayType: () => isPgArrayType,
572
571
  kloudMeta: () => kloudMeta,
573
572
  normalisePGliteUrl: () => normalisePGliteUrl,
@@ -5556,39 +5555,25 @@ var copy = (it) => {
5556
5555
  var objectValues = (obj) => {
5557
5556
  return Object.values(obj);
5558
5557
  };
5559
- var assertV1OutFolder = (out) => {
5558
+ var assertV3OutFolder = (out) => {
5560
5559
  if (!(0, import_fs.existsSync)(out))
5561
5560
  return;
5562
- const oldMigrationFolders = (0, import_fs.readdirSync)(out).filter(
5563
- (it) => it.length === 14 && /^\d+$/.test(it)
5561
+ if (!(0, import_fs.existsSync)((0, import_path.join)(out, "meta")))
5562
+ return;
5563
+ console.log(
5564
+ `Your migrations folder format is outdated, please run ${source_default.green.bold(
5565
+ `drizzle-kit up`
5566
+ )}`
5564
5567
  );
5565
- if (oldMigrationFolders.length > 0) {
5566
- console.log(
5567
- `Your migrations folder format is outdated, please run ${source_default.green.bold(
5568
- `drizzle-kit up`
5569
- )}`
5570
- );
5571
- process.exit(1);
5572
- }
5573
- };
5574
- var dryJournal = (dialect3) => {
5575
- return {
5576
- version: snapshotVersion,
5577
- dialect: dialect3,
5578
- entries: []
5579
- };
5568
+ process.exit(1);
5580
5569
  };
5581
5570
  var prepareOutFolder = (out, dialect3) => {
5582
- const meta = (0, import_path.join)(out, "meta");
5583
- const journalPath = (0, import_path.join)(meta, "_journal.json");
5584
- if (!(0, import_fs.existsSync)((0, import_path.join)(out, "meta"))) {
5585
- (0, import_fs.mkdirSync)(meta, { recursive: true });
5586
- (0, import_fs.writeFileSync)(journalPath, JSON.stringify(dryJournal(dialect3)));
5587
- }
5588
- const journal = JSON.parse((0, import_fs.readFileSync)(journalPath).toString());
5589
- const snapshots = (0, import_fs.readdirSync)(meta).filter((it) => !it.startsWith("_")).map((it) => (0, import_path.join)(meta, it));
5571
+ (0, import_fs.mkdirSync)(out, { recursive: true });
5572
+ const snapshots = (0, import_fs.readdirSync)(out).filter((it) => (0, import_fs.lstatSync)((0, import_path.join)(out, it)).isDirectory()).map(
5573
+ (it) => (0, import_path.join)(out, it, "snapshot.json")
5574
+ );
5590
5575
  snapshots.sort();
5591
- return { meta, snapshots, journal };
5576
+ return snapshots;
5592
5577
  };
5593
5578
  var validatorForDialect = (dialect3) => {
5594
5579
  switch (dialect3) {
@@ -5643,7 +5628,7 @@ var validateWithReport = (snapshots, dialect3) => {
5643
5628
  return result;
5644
5629
  };
5645
5630
  var prepareMigrationFolder = (outFolder = "drizzle", dialect3) => {
5646
- const { snapshots, journal } = prepareOutFolder(outFolder, dialect3);
5631
+ const snapshots = prepareOutFolder(outFolder, dialect3);
5647
5632
  const report = validateWithReport(snapshots, dialect3);
5648
5633
  if (report.nonLatest.length > 0) {
5649
5634
  console.log(
@@ -5675,7 +5660,7 @@ var prepareMigrationFolder = (outFolder = "drizzle", dialect3) => {
5675
5660
  if (abort) {
5676
5661
  process.exit(0);
5677
5662
  }
5678
- return { snapshots, journal };
5663
+ return snapshots;
5679
5664
  };
5680
5665
  var prepareMigrationMeta = (schemas, tables, columns) => {
5681
5666
  const _meta = {
@@ -5752,10 +5737,9 @@ function isPgArrayType(sqlType) {
5752
5737
  }
5753
5738
  // Annotate the CommonJS export names for ESM import in node:
5754
5739
  0 && (module.exports = {
5755
- assertV1OutFolder,
5740
+ assertV3OutFolder,
5756
5741
  columnRenameKey,
5757
5742
  copy,
5758
- dryJournal,
5759
5743
  isPgArrayType,
5760
5744
  kloudMeta,
5761
5745
  normalisePGliteUrl,
package/utils.mjs CHANGED
@@ -1052,7 +1052,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1052
1052
  var source_default = chalk;
1053
1053
 
1054
1054
  // src/utils.ts
1055
- import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "fs";
1055
+ import { existsSync, lstatSync, mkdirSync, readdirSync, readFileSync } from "fs";
1056
1056
  import { join } from "path";
1057
1057
  import { parse } from "url";
1058
1058
 
@@ -5536,39 +5536,25 @@ var copy = (it) => {
5536
5536
  var objectValues = (obj) => {
5537
5537
  return Object.values(obj);
5538
5538
  };
5539
- var assertV1OutFolder = (out) => {
5539
+ var assertV3OutFolder = (out) => {
5540
5540
  if (!existsSync(out))
5541
5541
  return;
5542
- const oldMigrationFolders = readdirSync(out).filter(
5543
- (it) => it.length === 14 && /^\d+$/.test(it)
5542
+ if (!existsSync(join(out, "meta")))
5543
+ return;
5544
+ console.log(
5545
+ `Your migrations folder format is outdated, please run ${source_default.green.bold(
5546
+ `drizzle-kit up`
5547
+ )}`
5544
5548
  );
5545
- if (oldMigrationFolders.length > 0) {
5546
- console.log(
5547
- `Your migrations folder format is outdated, please run ${source_default.green.bold(
5548
- `drizzle-kit up`
5549
- )}`
5550
- );
5551
- process.exit(1);
5552
- }
5553
- };
5554
- var dryJournal = (dialect3) => {
5555
- return {
5556
- version: snapshotVersion,
5557
- dialect: dialect3,
5558
- entries: []
5559
- };
5549
+ process.exit(1);
5560
5550
  };
5561
5551
  var prepareOutFolder = (out, dialect3) => {
5562
- const meta = join(out, "meta");
5563
- const journalPath = join(meta, "_journal.json");
5564
- if (!existsSync(join(out, "meta"))) {
5565
- mkdirSync(meta, { recursive: true });
5566
- writeFileSync(journalPath, JSON.stringify(dryJournal(dialect3)));
5567
- }
5568
- const journal = JSON.parse(readFileSync(journalPath).toString());
5569
- const snapshots = readdirSync(meta).filter((it) => !it.startsWith("_")).map((it) => join(meta, it));
5552
+ mkdirSync(out, { recursive: true });
5553
+ const snapshots = readdirSync(out).filter((it) => lstatSync(join(out, it)).isDirectory()).map(
5554
+ (it) => join(out, it, "snapshot.json")
5555
+ );
5570
5556
  snapshots.sort();
5571
- return { meta, snapshots, journal };
5557
+ return snapshots;
5572
5558
  };
5573
5559
  var validatorForDialect = (dialect3) => {
5574
5560
  switch (dialect3) {
@@ -5623,7 +5609,7 @@ var validateWithReport = (snapshots, dialect3) => {
5623
5609
  return result;
5624
5610
  };
5625
5611
  var prepareMigrationFolder = (outFolder = "drizzle", dialect3) => {
5626
- const { snapshots, journal } = prepareOutFolder(outFolder, dialect3);
5612
+ const snapshots = prepareOutFolder(outFolder, dialect3);
5627
5613
  const report = validateWithReport(snapshots, dialect3);
5628
5614
  if (report.nonLatest.length > 0) {
5629
5615
  console.log(
@@ -5655,7 +5641,7 @@ var prepareMigrationFolder = (outFolder = "drizzle", dialect3) => {
5655
5641
  if (abort) {
5656
5642
  process.exit(0);
5657
5643
  }
5658
- return { snapshots, journal };
5644
+ return snapshots;
5659
5645
  };
5660
5646
  var prepareMigrationMeta = (schemas, tables, columns) => {
5661
5647
  const _meta = {
@@ -5731,10 +5717,9 @@ function isPgArrayType(sqlType) {
5731
5717
  return sqlType.match(/.*\[\d*\].*|.*\[\].*/g) !== null;
5732
5718
  }
5733
5719
  export {
5734
- assertV1OutFolder,
5720
+ assertV3OutFolder,
5735
5721
  columnRenameKey,
5736
5722
  copy,
5737
- dryJournal,
5738
5723
  isPgArrayType,
5739
5724
  kloudMeta,
5740
5725
  normalisePGliteUrl,