drizzle-kit 0.27.0 → 0.27.1-4d56096
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/api.d.mts +3 -2
- package/api.d.ts +3 -2
- package/api.js +73 -21
- package/api.mjs +73 -21
- package/bin.cjs +47439 -47395
- package/index-BfiZoTqG.d.mts +293 -0
- package/index-BfiZoTqG.d.ts +293 -0
- package/index.d.mts +2 -287
- package/index.d.ts +2 -287
- package/package.json +4 -1
- package/common-DYjgLS6u.d.mts +0 -8
- package/common-DYjgLS6u.d.ts +0 -8
package/api.d.mts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
2
2
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
3
3
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
4
|
-
import { C as CasingType } from './
|
4
|
+
import { C as CasingType, a as Config } from './index-BfiZoTqG.mjs';
|
5
5
|
import * as zod from 'zod';
|
6
6
|
import { TypeOf } from 'zod';
|
7
|
+
import 'tls';
|
7
8
|
|
8
9
|
declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
|
9
10
|
version: zod.ZodLiteral<"5">;
|
@@ -2273,7 +2274,7 @@ type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
|
|
2273
2274
|
type DrizzleMySQLSnapshotJSON = MySqlSchema;
|
2274
2275
|
declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
|
2275
2276
|
declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
2276
|
-
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
|
2277
|
+
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2277
2278
|
hasDataLoss: boolean;
|
2278
2279
|
warnings: string[];
|
2279
2280
|
statementsToExecute: string[];
|
package/api.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
2
2
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
3
3
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
4
|
-
import { C as CasingType } from './
|
4
|
+
import { C as CasingType, a as Config } from './index-BfiZoTqG.js';
|
5
5
|
import * as zod from 'zod';
|
6
6
|
import { TypeOf } from 'zod';
|
7
|
+
import 'tls';
|
7
8
|
|
8
9
|
declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
|
9
10
|
version: zod.ZodLiteral<"5">;
|
@@ -2273,7 +2274,7 @@ type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
|
|
2273
2274
|
type DrizzleMySQLSnapshotJSON = MySqlSchema;
|
2274
2275
|
declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
|
2275
2276
|
declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
2276
|
-
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
|
2277
|
+
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2277
2278
|
hasDataLoss: boolean;
|
2278
2279
|
warnings: string[];
|
2279
2280
|
statementsToExecute: string[];
|
package/api.js
CHANGED
@@ -17520,6 +17520,7 @@ var init_snapshotsDiffer = __esm({
|
|
17520
17520
|
jsonStatements.push(...jsonCreatedCheckConstraints);
|
17521
17521
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
17522
17522
|
jsonStatements.push(...jsonAlterEnumsWithDroppedValues);
|
17523
|
+
jsonStatements.push(...createViews);
|
17523
17524
|
jsonStatements.push(...jsonRenamePoliciesStatements);
|
17524
17525
|
jsonStatements.push(...jsonDropPoliciesStatements);
|
17525
17526
|
jsonStatements.push(...jsonCreatePoliciesStatements);
|
@@ -17528,7 +17529,6 @@ var init_snapshotsDiffer = __esm({
|
|
17528
17529
|
jsonStatements.push(...jsonDropIndPoliciesStatements);
|
17529
17530
|
jsonStatements.push(...jsonCreateIndPoliciesStatements);
|
17530
17531
|
jsonStatements.push(...jsonAlterIndPoliciesStatements);
|
17531
|
-
jsonStatements.push(...createViews);
|
17532
17532
|
jsonStatements.push(...dropEnums);
|
17533
17533
|
jsonStatements.push(...dropSequences);
|
17534
17534
|
jsonStatements.push(...dropSchemas);
|
@@ -30212,7 +30212,7 @@ var init_blob = __esm({
|
|
30212
30212
|
return "blob";
|
30213
30213
|
}
|
30214
30214
|
mapFromDriverValue(value) {
|
30215
|
-
return BigInt(value.toString());
|
30215
|
+
return BigInt(Buffer.isBuffer(value) ? value.toString() : String.fromCodePoint(...value));
|
30216
30216
|
}
|
30217
30217
|
mapToDriverValue(value) {
|
30218
30218
|
return Buffer.from(value.toString());
|
@@ -30237,7 +30237,7 @@ var init_blob = __esm({
|
|
30237
30237
|
return "blob";
|
30238
30238
|
}
|
30239
30239
|
mapFromDriverValue(value) {
|
30240
|
-
return JSON.parse(value.toString());
|
30240
|
+
return JSON.parse(Buffer.isBuffer(value) ? value.toString() : String.fromCodePoint(...value));
|
30241
30241
|
}
|
30242
30242
|
mapToDriverValue(value) {
|
30243
30243
|
return Buffer.from(JSON.stringify(value));
|
@@ -34057,6 +34057,25 @@ WHERE
|
|
34057
34057
|
}
|
34058
34058
|
});
|
34059
34059
|
|
34060
|
+
// src/extensions/getTablesFilterByExtensions.ts
|
34061
|
+
var getTablesFilterByExtensions;
|
34062
|
+
var init_getTablesFilterByExtensions = __esm({
|
34063
|
+
"src/extensions/getTablesFilterByExtensions.ts"() {
|
34064
|
+
"use strict";
|
34065
|
+
getTablesFilterByExtensions = ({
|
34066
|
+
extensionsFilters,
|
34067
|
+
dialect: dialect4
|
34068
|
+
}) => {
|
34069
|
+
if (extensionsFilters) {
|
34070
|
+
if (extensionsFilters.includes("postgis") && dialect4 === "postgresql") {
|
34071
|
+
return ["!geography_columns", "!geometry_columns", "!spatial_ref_sys"];
|
34072
|
+
}
|
34073
|
+
}
|
34074
|
+
return [];
|
34075
|
+
};
|
34076
|
+
}
|
34077
|
+
});
|
34078
|
+
|
34060
34079
|
// ../drizzle-orm/dist/mysql-core/alias.js
|
34061
34080
|
var init_alias4 = __esm({
|
34062
34081
|
"../drizzle-orm/dist/mysql-core/alias.js"() {
|
@@ -34679,7 +34698,7 @@ var init_datetime = __esm({
|
|
34679
34698
|
// ../drizzle-orm/dist/mysql-core/columns/decimal.js
|
34680
34699
|
function decimal(a, b = {}) {
|
34681
34700
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34682
|
-
return new MySqlDecimalBuilder(name2, config
|
34701
|
+
return new MySqlDecimalBuilder(name2, config);
|
34683
34702
|
}
|
34684
34703
|
var _a259, _b182, MySqlDecimalBuilder, _a260, _b183, MySqlDecimal;
|
34685
34704
|
var init_decimal = __esm({
|
@@ -34689,10 +34708,11 @@ var init_decimal = __esm({
|
|
34689
34708
|
init_utils2();
|
34690
34709
|
init_common4();
|
34691
34710
|
MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b182) {
|
34692
|
-
constructor(name2,
|
34711
|
+
constructor(name2, config) {
|
34693
34712
|
super(name2, "string", "MySqlDecimal");
|
34694
|
-
this.config.precision = precision;
|
34695
|
-
this.config.scale = scale;
|
34713
|
+
this.config.precision = config?.precision;
|
34714
|
+
this.config.scale = config?.scale;
|
34715
|
+
this.config.unsigned = config?.unsigned;
|
34696
34716
|
}
|
34697
34717
|
/** @internal */
|
34698
34718
|
build(table4) {
|
@@ -34708,15 +34728,19 @@ var init_decimal = __esm({
|
|
34708
34728
|
super(...arguments);
|
34709
34729
|
__publicField(this, "precision", this.config.precision);
|
34710
34730
|
__publicField(this, "scale", this.config.scale);
|
34731
|
+
__publicField(this, "unsigned", this.config.unsigned);
|
34711
34732
|
}
|
34712
34733
|
getSQLType() {
|
34734
|
+
let type = "";
|
34713
34735
|
if (this.precision !== void 0 && this.scale !== void 0) {
|
34714
|
-
|
34736
|
+
type += `decimal(${this.precision},${this.scale})`;
|
34715
34737
|
} else if (this.precision === void 0) {
|
34716
|
-
|
34738
|
+
type += "decimal";
|
34717
34739
|
} else {
|
34718
|
-
|
34740
|
+
type += `decimal(${this.precision})`;
|
34719
34741
|
}
|
34742
|
+
type = type === "decimal(10,0)" || type === "decimal(10)" ? "decimal" : type;
|
34743
|
+
return this.unsigned ? `${type} unsigned` : type;
|
34720
34744
|
}
|
34721
34745
|
};
|
34722
34746
|
__publicField(MySqlDecimal, _a260, "MySqlDecimal");
|
@@ -34740,6 +34764,7 @@ var init_double = __esm({
|
|
34740
34764
|
super(name2, "number", "MySqlDouble");
|
34741
34765
|
this.config.precision = config?.precision;
|
34742
34766
|
this.config.scale = config?.scale;
|
34767
|
+
this.config.unsigned = config?.unsigned;
|
34743
34768
|
}
|
34744
34769
|
/** @internal */
|
34745
34770
|
build(table4) {
|
@@ -34752,15 +34777,18 @@ var init_double = __esm({
|
|
34752
34777
|
super(...arguments);
|
34753
34778
|
__publicField(this, "precision", this.config.precision);
|
34754
34779
|
__publicField(this, "scale", this.config.scale);
|
34780
|
+
__publicField(this, "unsigned", this.config.unsigned);
|
34755
34781
|
}
|
34756
34782
|
getSQLType() {
|
34783
|
+
let type = "";
|
34757
34784
|
if (this.precision !== void 0 && this.scale !== void 0) {
|
34758
|
-
|
34785
|
+
type += `double(${this.precision},${this.scale})`;
|
34759
34786
|
} else if (this.precision === void 0) {
|
34760
|
-
|
34787
|
+
type += "double";
|
34761
34788
|
} else {
|
34762
|
-
|
34789
|
+
type += `double(${this.precision})`;
|
34763
34790
|
}
|
34791
|
+
return this.unsigned ? `${type} unsigned` : type;
|
34764
34792
|
}
|
34765
34793
|
};
|
34766
34794
|
__publicField(MySqlDouble, _a262, "MySqlDouble");
|
@@ -34810,18 +34838,23 @@ var init_enum2 = __esm({
|
|
34810
34838
|
});
|
34811
34839
|
|
34812
34840
|
// ../drizzle-orm/dist/mysql-core/columns/float.js
|
34813
|
-
function float(
|
34814
|
-
|
34841
|
+
function float(a, b) {
|
34842
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34843
|
+
return new MySqlFloatBuilder(name2, config);
|
34815
34844
|
}
|
34816
34845
|
var _a265, _b188, MySqlFloatBuilder, _a266, _b189, MySqlFloat;
|
34817
34846
|
var init_float = __esm({
|
34818
34847
|
"../drizzle-orm/dist/mysql-core/columns/float.js"() {
|
34819
34848
|
"use strict";
|
34820
34849
|
init_entity();
|
34850
|
+
init_utils2();
|
34821
34851
|
init_common4();
|
34822
34852
|
MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b188) {
|
34823
|
-
constructor(name2) {
|
34853
|
+
constructor(name2, config) {
|
34824
34854
|
super(name2, "number", "MySqlFloat");
|
34855
|
+
this.config.precision = config?.precision;
|
34856
|
+
this.config.scale = config?.scale;
|
34857
|
+
this.config.unsigned = config?.unsigned;
|
34825
34858
|
}
|
34826
34859
|
/** @internal */
|
34827
34860
|
build(table4) {
|
@@ -34830,8 +34863,22 @@ var init_float = __esm({
|
|
34830
34863
|
};
|
34831
34864
|
__publicField(MySqlFloatBuilder, _a265, "MySqlFloatBuilder");
|
34832
34865
|
MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b189) {
|
34866
|
+
constructor() {
|
34867
|
+
super(...arguments);
|
34868
|
+
__publicField(this, "precision", this.config.precision);
|
34869
|
+
__publicField(this, "scale", this.config.scale);
|
34870
|
+
__publicField(this, "unsigned", this.config.unsigned);
|
34871
|
+
}
|
34833
34872
|
getSQLType() {
|
34834
|
-
|
34873
|
+
let type = "";
|
34874
|
+
if (this.precision !== void 0 && this.scale !== void 0) {
|
34875
|
+
type += `float(${this.precision},${this.scale})`;
|
34876
|
+
} else if (this.precision === void 0) {
|
34877
|
+
type += "float";
|
34878
|
+
} else {
|
34879
|
+
type += `float(${this.precision})`;
|
34880
|
+
}
|
34881
|
+
return this.unsigned ? `${type} unsigned` : type;
|
34835
34882
|
}
|
34836
34883
|
};
|
34837
34884
|
__publicField(MySqlFloat, _a266, "MySqlFloat");
|
@@ -38823,8 +38870,8 @@ ${withStyle.errorWarning(
|
|
38823
38870
|
changedType = columnType.replace("bigint unsigned", "serial");
|
38824
38871
|
}
|
38825
38872
|
}
|
38826
|
-
if (columnType.
|
38827
|
-
changedType = "
|
38873
|
+
if (columnType.includes("decimal(10,0)")) {
|
38874
|
+
changedType = columnType.replace("decimal(10,0)", "decimal");
|
38828
38875
|
}
|
38829
38876
|
let onUpdate = void 0;
|
38830
38877
|
if (columnType.startsWith("timestamp") && typeof columnExtra !== "undefined" && columnExtra.includes("on update CURRENT_TIMESTAMP")) {
|
@@ -39346,6 +39393,7 @@ var init_utils9 = __esm({
|
|
39346
39393
|
"use strict";
|
39347
39394
|
import_hanji7 = __toESM(require_hanji());
|
39348
39395
|
init_lib();
|
39396
|
+
init_getTablesFilterByExtensions();
|
39349
39397
|
init_global();
|
39350
39398
|
init_schemaValidator();
|
39351
39399
|
init_serializer();
|
@@ -40302,6 +40350,7 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
40302
40350
|
|
40303
40351
|
// src/api.ts
|
40304
40352
|
init_sqlitePushUtils();
|
40353
|
+
init_getTablesFilterByExtensions();
|
40305
40354
|
init_global();
|
40306
40355
|
init_migrationPreparator();
|
40307
40356
|
init_mysqlSchema();
|
@@ -40355,9 +40404,12 @@ var generateMigration = async (prev, cur) => {
|
|
40355
40404
|
);
|
40356
40405
|
return sqlStatements;
|
40357
40406
|
};
|
40358
|
-
var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
40407
|
+
var pushSchema = async (imports, drizzleInstance, schemaFilters, tablesFilter, extensionsFilters) => {
|
40359
40408
|
const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
40360
40409
|
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
40410
|
+
const filters = (tablesFilter ?? []).concat(
|
40411
|
+
getTablesFilterByExtensions({ extensionsFilters, dialect: "postgresql" })
|
40412
|
+
);
|
40361
40413
|
const db = {
|
40362
40414
|
query: async (query, params) => {
|
40363
40415
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -40367,7 +40419,7 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
|
40367
40419
|
const cur = generateDrizzleJson(imports);
|
40368
40420
|
const { schema: prev } = await pgPushIntrospect(
|
40369
40421
|
db,
|
40370
|
-
|
40422
|
+
filters,
|
40371
40423
|
schemaFilters ?? ["public"],
|
40372
40424
|
void 0
|
40373
40425
|
);
|
package/api.mjs
CHANGED
@@ -17525,6 +17525,7 @@ var init_snapshotsDiffer = __esm({
|
|
17525
17525
|
jsonStatements.push(...jsonCreatedCheckConstraints);
|
17526
17526
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
17527
17527
|
jsonStatements.push(...jsonAlterEnumsWithDroppedValues);
|
17528
|
+
jsonStatements.push(...createViews);
|
17528
17529
|
jsonStatements.push(...jsonRenamePoliciesStatements);
|
17529
17530
|
jsonStatements.push(...jsonDropPoliciesStatements);
|
17530
17531
|
jsonStatements.push(...jsonCreatePoliciesStatements);
|
@@ -17533,7 +17534,6 @@ var init_snapshotsDiffer = __esm({
|
|
17533
17534
|
jsonStatements.push(...jsonDropIndPoliciesStatements);
|
17534
17535
|
jsonStatements.push(...jsonCreateIndPoliciesStatements);
|
17535
17536
|
jsonStatements.push(...jsonAlterIndPoliciesStatements);
|
17536
|
-
jsonStatements.push(...createViews);
|
17537
17537
|
jsonStatements.push(...dropEnums);
|
17538
17538
|
jsonStatements.push(...dropSequences);
|
17539
17539
|
jsonStatements.push(...dropSchemas);
|
@@ -30217,7 +30217,7 @@ var init_blob = __esm({
|
|
30217
30217
|
return "blob";
|
30218
30218
|
}
|
30219
30219
|
mapFromDriverValue(value) {
|
30220
|
-
return BigInt(value.toString());
|
30220
|
+
return BigInt(Buffer.isBuffer(value) ? value.toString() : String.fromCodePoint(...value));
|
30221
30221
|
}
|
30222
30222
|
mapToDriverValue(value) {
|
30223
30223
|
return Buffer.from(value.toString());
|
@@ -30242,7 +30242,7 @@ var init_blob = __esm({
|
|
30242
30242
|
return "blob";
|
30243
30243
|
}
|
30244
30244
|
mapFromDriverValue(value) {
|
30245
|
-
return JSON.parse(value.toString());
|
30245
|
+
return JSON.parse(Buffer.isBuffer(value) ? value.toString() : String.fromCodePoint(...value));
|
30246
30246
|
}
|
30247
30247
|
mapToDriverValue(value) {
|
30248
30248
|
return Buffer.from(JSON.stringify(value));
|
@@ -34062,6 +34062,25 @@ WHERE
|
|
34062
34062
|
}
|
34063
34063
|
});
|
34064
34064
|
|
34065
|
+
// src/extensions/getTablesFilterByExtensions.ts
|
34066
|
+
var getTablesFilterByExtensions;
|
34067
|
+
var init_getTablesFilterByExtensions = __esm({
|
34068
|
+
"src/extensions/getTablesFilterByExtensions.ts"() {
|
34069
|
+
"use strict";
|
34070
|
+
getTablesFilterByExtensions = ({
|
34071
|
+
extensionsFilters,
|
34072
|
+
dialect: dialect4
|
34073
|
+
}) => {
|
34074
|
+
if (extensionsFilters) {
|
34075
|
+
if (extensionsFilters.includes("postgis") && dialect4 === "postgresql") {
|
34076
|
+
return ["!geography_columns", "!geometry_columns", "!spatial_ref_sys"];
|
34077
|
+
}
|
34078
|
+
}
|
34079
|
+
return [];
|
34080
|
+
};
|
34081
|
+
}
|
34082
|
+
});
|
34083
|
+
|
34065
34084
|
// ../drizzle-orm/dist/mysql-core/alias.js
|
34066
34085
|
var init_alias4 = __esm({
|
34067
34086
|
"../drizzle-orm/dist/mysql-core/alias.js"() {
|
@@ -34684,7 +34703,7 @@ var init_datetime = __esm({
|
|
34684
34703
|
// ../drizzle-orm/dist/mysql-core/columns/decimal.js
|
34685
34704
|
function decimal(a, b = {}) {
|
34686
34705
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34687
|
-
return new MySqlDecimalBuilder(name2, config
|
34706
|
+
return new MySqlDecimalBuilder(name2, config);
|
34688
34707
|
}
|
34689
34708
|
var _a259, _b182, MySqlDecimalBuilder, _a260, _b183, MySqlDecimal;
|
34690
34709
|
var init_decimal = __esm({
|
@@ -34694,10 +34713,11 @@ var init_decimal = __esm({
|
|
34694
34713
|
init_utils2();
|
34695
34714
|
init_common4();
|
34696
34715
|
MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b182) {
|
34697
|
-
constructor(name2,
|
34716
|
+
constructor(name2, config) {
|
34698
34717
|
super(name2, "string", "MySqlDecimal");
|
34699
|
-
this.config.precision = precision;
|
34700
|
-
this.config.scale = scale;
|
34718
|
+
this.config.precision = config?.precision;
|
34719
|
+
this.config.scale = config?.scale;
|
34720
|
+
this.config.unsigned = config?.unsigned;
|
34701
34721
|
}
|
34702
34722
|
/** @internal */
|
34703
34723
|
build(table4) {
|
@@ -34713,15 +34733,19 @@ var init_decimal = __esm({
|
|
34713
34733
|
super(...arguments);
|
34714
34734
|
__publicField(this, "precision", this.config.precision);
|
34715
34735
|
__publicField(this, "scale", this.config.scale);
|
34736
|
+
__publicField(this, "unsigned", this.config.unsigned);
|
34716
34737
|
}
|
34717
34738
|
getSQLType() {
|
34739
|
+
let type = "";
|
34718
34740
|
if (this.precision !== void 0 && this.scale !== void 0) {
|
34719
|
-
|
34741
|
+
type += `decimal(${this.precision},${this.scale})`;
|
34720
34742
|
} else if (this.precision === void 0) {
|
34721
|
-
|
34743
|
+
type += "decimal";
|
34722
34744
|
} else {
|
34723
|
-
|
34745
|
+
type += `decimal(${this.precision})`;
|
34724
34746
|
}
|
34747
|
+
type = type === "decimal(10,0)" || type === "decimal(10)" ? "decimal" : type;
|
34748
|
+
return this.unsigned ? `${type} unsigned` : type;
|
34725
34749
|
}
|
34726
34750
|
};
|
34727
34751
|
__publicField(MySqlDecimal, _a260, "MySqlDecimal");
|
@@ -34745,6 +34769,7 @@ var init_double = __esm({
|
|
34745
34769
|
super(name2, "number", "MySqlDouble");
|
34746
34770
|
this.config.precision = config?.precision;
|
34747
34771
|
this.config.scale = config?.scale;
|
34772
|
+
this.config.unsigned = config?.unsigned;
|
34748
34773
|
}
|
34749
34774
|
/** @internal */
|
34750
34775
|
build(table4) {
|
@@ -34757,15 +34782,18 @@ var init_double = __esm({
|
|
34757
34782
|
super(...arguments);
|
34758
34783
|
__publicField(this, "precision", this.config.precision);
|
34759
34784
|
__publicField(this, "scale", this.config.scale);
|
34785
|
+
__publicField(this, "unsigned", this.config.unsigned);
|
34760
34786
|
}
|
34761
34787
|
getSQLType() {
|
34788
|
+
let type = "";
|
34762
34789
|
if (this.precision !== void 0 && this.scale !== void 0) {
|
34763
|
-
|
34790
|
+
type += `double(${this.precision},${this.scale})`;
|
34764
34791
|
} else if (this.precision === void 0) {
|
34765
|
-
|
34792
|
+
type += "double";
|
34766
34793
|
} else {
|
34767
|
-
|
34794
|
+
type += `double(${this.precision})`;
|
34768
34795
|
}
|
34796
|
+
return this.unsigned ? `${type} unsigned` : type;
|
34769
34797
|
}
|
34770
34798
|
};
|
34771
34799
|
__publicField(MySqlDouble, _a262, "MySqlDouble");
|
@@ -34815,18 +34843,23 @@ var init_enum2 = __esm({
|
|
34815
34843
|
});
|
34816
34844
|
|
34817
34845
|
// ../drizzle-orm/dist/mysql-core/columns/float.js
|
34818
|
-
function float(
|
34819
|
-
|
34846
|
+
function float(a, b) {
|
34847
|
+
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34848
|
+
return new MySqlFloatBuilder(name2, config);
|
34820
34849
|
}
|
34821
34850
|
var _a265, _b188, MySqlFloatBuilder, _a266, _b189, MySqlFloat;
|
34822
34851
|
var init_float = __esm({
|
34823
34852
|
"../drizzle-orm/dist/mysql-core/columns/float.js"() {
|
34824
34853
|
"use strict";
|
34825
34854
|
init_entity();
|
34855
|
+
init_utils2();
|
34826
34856
|
init_common4();
|
34827
34857
|
MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b188) {
|
34828
|
-
constructor(name2) {
|
34858
|
+
constructor(name2, config) {
|
34829
34859
|
super(name2, "number", "MySqlFloat");
|
34860
|
+
this.config.precision = config?.precision;
|
34861
|
+
this.config.scale = config?.scale;
|
34862
|
+
this.config.unsigned = config?.unsigned;
|
34830
34863
|
}
|
34831
34864
|
/** @internal */
|
34832
34865
|
build(table4) {
|
@@ -34835,8 +34868,22 @@ var init_float = __esm({
|
|
34835
34868
|
};
|
34836
34869
|
__publicField(MySqlFloatBuilder, _a265, "MySqlFloatBuilder");
|
34837
34870
|
MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b189) {
|
34871
|
+
constructor() {
|
34872
|
+
super(...arguments);
|
34873
|
+
__publicField(this, "precision", this.config.precision);
|
34874
|
+
__publicField(this, "scale", this.config.scale);
|
34875
|
+
__publicField(this, "unsigned", this.config.unsigned);
|
34876
|
+
}
|
34838
34877
|
getSQLType() {
|
34839
|
-
|
34878
|
+
let type = "";
|
34879
|
+
if (this.precision !== void 0 && this.scale !== void 0) {
|
34880
|
+
type += `float(${this.precision},${this.scale})`;
|
34881
|
+
} else if (this.precision === void 0) {
|
34882
|
+
type += "float";
|
34883
|
+
} else {
|
34884
|
+
type += `float(${this.precision})`;
|
34885
|
+
}
|
34886
|
+
return this.unsigned ? `${type} unsigned` : type;
|
34840
34887
|
}
|
34841
34888
|
};
|
34842
34889
|
__publicField(MySqlFloat, _a266, "MySqlFloat");
|
@@ -38828,8 +38875,8 @@ ${withStyle.errorWarning(
|
|
38828
38875
|
changedType = columnType.replace("bigint unsigned", "serial");
|
38829
38876
|
}
|
38830
38877
|
}
|
38831
|
-
if (columnType.
|
38832
|
-
changedType = "
|
38878
|
+
if (columnType.includes("decimal(10,0)")) {
|
38879
|
+
changedType = columnType.replace("decimal(10,0)", "decimal");
|
38833
38880
|
}
|
38834
38881
|
let onUpdate = void 0;
|
38835
38882
|
if (columnType.startsWith("timestamp") && typeof columnExtra !== "undefined" && columnExtra.includes("on update CURRENT_TIMESTAMP")) {
|
@@ -39351,6 +39398,7 @@ var init_utils9 = __esm({
|
|
39351
39398
|
"use strict";
|
39352
39399
|
import_hanji7 = __toESM(require_hanji());
|
39353
39400
|
init_lib();
|
39401
|
+
init_getTablesFilterByExtensions();
|
39354
39402
|
init_global();
|
39355
39403
|
init_schemaValidator();
|
39356
39404
|
init_serializer();
|
@@ -40293,6 +40341,7 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
40293
40341
|
|
40294
40342
|
// src/api.ts
|
40295
40343
|
init_sqlitePushUtils();
|
40344
|
+
init_getTablesFilterByExtensions();
|
40296
40345
|
init_global();
|
40297
40346
|
init_migrationPreparator();
|
40298
40347
|
init_mysqlSchema();
|
@@ -40346,9 +40395,12 @@ var generateMigration = async (prev, cur) => {
|
|
40346
40395
|
);
|
40347
40396
|
return sqlStatements;
|
40348
40397
|
};
|
40349
|
-
var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
40398
|
+
var pushSchema = async (imports, drizzleInstance, schemaFilters, tablesFilter, extensionsFilters) => {
|
40350
40399
|
const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
40351
40400
|
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
40401
|
+
const filters = (tablesFilter ?? []).concat(
|
40402
|
+
getTablesFilterByExtensions({ extensionsFilters, dialect: "postgresql" })
|
40403
|
+
);
|
40352
40404
|
const db = {
|
40353
40405
|
query: async (query, params) => {
|
40354
40406
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -40358,7 +40410,7 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
|
40358
40410
|
const cur = generateDrizzleJson(imports);
|
40359
40411
|
const { schema: prev } = await pgPushIntrospect(
|
40360
40412
|
db,
|
40361
|
-
|
40413
|
+
filters,
|
40362
40414
|
schemaFilters ?? ["public"],
|
40363
40415
|
void 0
|
40364
40416
|
);
|