drizzle-kit 0.27.1-4d56096 → 0.27.1-93aad0e
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 +16 -3
- package/api.d.ts +16 -3
- package/api.js +79 -97
- package/api.mjs +79 -97
- package/bin.cjs +47431 -47449
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +287 -2
- package/index.d.ts +287 -2
- package/package.json +1 -4
- package/utils.js +2 -1
- package/utils.mjs +2 -1
- package/index-BfiZoTqG.d.mts +0 -293
- package/index-BfiZoTqG.d.ts +0 -293
package/api.mjs
CHANGED
@@ -7761,7 +7761,8 @@ var init_pgSchema = __esm({
|
|
7761
7761
|
to: stringType().array().optional(),
|
7762
7762
|
using: stringType().optional(),
|
7763
7763
|
withCheck: stringType().optional(),
|
7764
|
-
on: stringType().optional()
|
7764
|
+
on: stringType().optional(),
|
7765
|
+
schema: stringType().optional()
|
7765
7766
|
}).strict();
|
7766
7767
|
policySquashed = objectType({
|
7767
7768
|
name: stringType(),
|
@@ -8096,6 +8097,16 @@ var init_pgSchema = __esm({
|
|
8096
8097
|
squashPolicyPush: (policy4) => {
|
8097
8098
|
return `${policy4.name}--${policy4.as}--${policy4.for}--${policy4.to?.join(",")}--${policy4.on}`;
|
8098
8099
|
},
|
8100
|
+
unsquashPolicyPush: (policy4) => {
|
8101
|
+
const splitted = policy4.split("--");
|
8102
|
+
return {
|
8103
|
+
name: splitted[0],
|
8104
|
+
as: splitted[1],
|
8105
|
+
for: splitted[2],
|
8106
|
+
to: splitted[3].split(","),
|
8107
|
+
on: splitted[4] !== "undefined" ? splitted[4] : void 0
|
8108
|
+
};
|
8109
|
+
},
|
8099
8110
|
squashPK: (pk) => {
|
8100
8111
|
return `${pk.columns.join(",")};${pk.name}`;
|
8101
8112
|
},
|
@@ -12058,9 +12069,9 @@ var init_sqlgenerator = __esm({
|
|
12058
12069
|
can(statement, dialect4) {
|
12059
12070
|
return statement.type === "alter_policy" && dialect4 === "postgresql";
|
12060
12071
|
}
|
12061
|
-
convert(statement) {
|
12062
|
-
const newPolicy = PgSquasher.unsquashPolicy(statement.newData);
|
12063
|
-
const oldPolicy = PgSquasher.unsquashPolicy(statement.oldData);
|
12072
|
+
convert(statement, _dialect, action) {
|
12073
|
+
const newPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(statement.newData) : PgSquasher.unsquashPolicy(statement.newData);
|
12074
|
+
const oldPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(statement.oldData) : PgSquasher.unsquashPolicy(statement.oldData);
|
12064
12075
|
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12065
12076
|
const usingPart = newPolicy.using ? ` USING (${newPolicy.using})` : oldPolicy.using ? ` USING (${oldPolicy.using})` : "";
|
12066
12077
|
const withCheckPart = newPolicy.withCheck ? ` WITH CHECK (${newPolicy.withCheck})` : oldPolicy.withCheck ? ` WITH CHECK (${oldPolicy.withCheck})` : "";
|
@@ -12780,7 +12791,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
12780
12791
|
can(statement, dialect4) {
|
12781
12792
|
return statement.type === "drop_table" && dialect4 === "postgresql";
|
12782
12793
|
}
|
12783
|
-
convert(statement) {
|
12794
|
+
convert(statement, _d5, action) {
|
12784
12795
|
const { tableName, schema: schema4, policies } = statement;
|
12785
12796
|
const tableNameWithSchema = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
|
12786
12797
|
const dropPolicyConvertor = new PgDropPolicyConvertor();
|
@@ -12788,7 +12799,7 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
12788
12799
|
return dropPolicyConvertor.convert({
|
12789
12800
|
type: "drop_policy",
|
12790
12801
|
tableName,
|
12791
|
-
data: PgSquasher.unsquashPolicy(p),
|
12802
|
+
data: action === "push" ? PgSquasher.unsquashPolicyPush(p) : PgSquasher.unsquashPolicy(p),
|
12792
12803
|
schema: schema4
|
12793
12804
|
});
|
12794
12805
|
}) ?? [];
|
@@ -16775,8 +16786,10 @@ var init_snapshotsDiffer = __esm({
|
|
16775
16786
|
const { renamed, created: created2, deleted: deleted2 } = await policyResolver2({
|
16776
16787
|
tableName: entry.name,
|
16777
16788
|
schema: entry.schema,
|
16778
|
-
deleted: entry.policies.deleted.map(
|
16779
|
-
|
16789
|
+
deleted: entry.policies.deleted.map(
|
16790
|
+
action === "push" ? PgSquasher.unsquashPolicyPush : PgSquasher.unsquashPolicy
|
16791
|
+
),
|
16792
|
+
created: entry.policies.added.map(action === "push" ? PgSquasher.unsquashPolicyPush : PgSquasher.unsquashPolicy)
|
16780
16793
|
});
|
16781
16794
|
if (created2.length > 0) {
|
16782
16795
|
policyCreates.push({
|
@@ -16816,7 +16829,7 @@ var init_snapshotsDiffer = __esm({
|
|
16816
16829
|
(policyKey, policy4) => {
|
16817
16830
|
const rens = policyRenamesDict[`${tableValue.schema || "public"}.${tableValue.name}`] || [];
|
16818
16831
|
const newName = columnChangeFor(policyKey, rens);
|
16819
|
-
const unsquashedPolicy = PgSquasher.unsquashPolicy(policy4);
|
16832
|
+
const unsquashedPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(policy4) : PgSquasher.unsquashPolicy(policy4);
|
16820
16833
|
unsquashedPolicy.name = newName;
|
16821
16834
|
policy4 = PgSquasher.squashPolicy(unsquashedPolicy);
|
16822
16835
|
return newName;
|
@@ -16830,8 +16843,12 @@ var init_snapshotsDiffer = __esm({
|
|
16830
16843
|
const indPolicyCreates = [];
|
16831
16844
|
const indPolicyDeletes = [];
|
16832
16845
|
const { renamed: indPolicyRenames, created, deleted } = await indPolicyResolver2({
|
16833
|
-
deleted: indPolicyRes.deleted.map(
|
16834
|
-
|
16846
|
+
deleted: indPolicyRes.deleted.map(
|
16847
|
+
(t) => action === "push" ? PgSquasher.unsquashPolicyPush(t.values) : PgSquasher.unsquashPolicy(t.values)
|
16848
|
+
),
|
16849
|
+
created: indPolicyRes.added.map(
|
16850
|
+
(t) => action === "push" ? PgSquasher.unsquashPolicyPush(t.values) : PgSquasher.unsquashPolicy(t.values)
|
16851
|
+
)
|
16835
16852
|
});
|
16836
16853
|
if (created.length > 0) {
|
16837
16854
|
indPolicyCreates.push({
|
@@ -17106,9 +17123,9 @@ var init_snapshotsDiffer = __esm({
|
|
17106
17123
|
);
|
17107
17124
|
}
|
17108
17125
|
typedResult.alteredPolicies.forEach(({ values }) => {
|
17109
|
-
const policy4 = PgSquasher.unsquashPolicy(values);
|
17110
|
-
const newPolicy = PgSquasher.unsquashPolicy(json22.policies[policy4.name].values);
|
17111
|
-
const oldPolicy = PgSquasher.unsquashPolicy(json1.policies[policy4.name].values);
|
17126
|
+
const policy4 = action === "push" ? PgSquasher.unsquashPolicyPush(values) : PgSquasher.unsquashPolicy(values);
|
17127
|
+
const newPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(json22.policies[policy4.name].values) : PgSquasher.unsquashPolicy(json22.policies[policy4.name].values);
|
17128
|
+
const oldPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(json22.policies[policy4.name].values) : PgSquasher.unsquashPolicy(json1.policies[policy4.name].values);
|
17112
17129
|
if (newPolicy.as !== oldPolicy.as) {
|
17113
17130
|
jsonDropIndPoliciesStatements.push(
|
17114
17131
|
...prepareDropIndPolicyJsons(
|
@@ -17167,8 +17184,8 @@ var init_snapshotsDiffer = __esm({
|
|
17167
17184
|
}
|
17168
17185
|
alteredTables.forEach((it) => {
|
17169
17186
|
Object.keys(it.alteredPolicies).forEach((policyName) => {
|
17170
|
-
const newPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__new);
|
17171
|
-
const oldPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__old);
|
17187
|
+
const newPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(it.alteredPolicies[policyName].__new) : PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__new);
|
17188
|
+
const oldPolicy = action === "push" ? PgSquasher.unsquashPolicyPush(it.alteredPolicies[policyName].__old) : PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__old);
|
17172
17189
|
if (newPolicy.as !== oldPolicy.as) {
|
17173
17190
|
jsonDropPoliciesStatements.push(
|
17174
17191
|
...prepareDropPolicyJsons(
|
@@ -17222,7 +17239,8 @@ var init_snapshotsDiffer = __esm({
|
|
17222
17239
|
if (policiesInPreviousState.length > 0 && policiesInCurrentState.length === 0 && !table4.isRLSEnabled) {
|
17223
17240
|
jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
|
17224
17241
|
}
|
17225
|
-
|
17242
|
+
const wasRlsEnabled = tableInPreviousState ? tableInPreviousState.isRLSEnabled : false;
|
17243
|
+
if (table4.isRLSEnabled !== wasRlsEnabled) {
|
17226
17244
|
if (table4.isRLSEnabled) {
|
17227
17245
|
jsonEnableRLSStatements.push({ type: "enable_rls", tableName: table4.name, schema: table4.schema });
|
17228
17246
|
} else if (!table4.isRLSEnabled && policiesInCurrentState.length === 0) {
|
@@ -17349,7 +17367,11 @@ var init_snapshotsDiffer = __esm({
|
|
17349
17367
|
});
|
17350
17368
|
jsonCreatePoliciesStatements.push(...[].concat(
|
17351
17369
|
...createdTables.map(
|
17352
|
-
(it) => prepareCreatePolicyJsons(
|
17370
|
+
(it) => prepareCreatePolicyJsons(
|
17371
|
+
it.name,
|
17372
|
+
it.schema,
|
17373
|
+
Object.values(it.policies).map(action === "push" ? PgSquasher.unsquashPolicyPush : PgSquasher.unsquashPolicy)
|
17374
|
+
)
|
17353
17375
|
)
|
17354
17376
|
));
|
17355
17377
|
const createViews = [];
|
@@ -17564,7 +17586,7 @@ var init_snapshotsDiffer = __esm({
|
|
17564
17586
|
}
|
17565
17587
|
return true;
|
17566
17588
|
});
|
17567
|
-
const sqlStatements = fromJson(filteredEnumsJsonStatements, "postgresql");
|
17589
|
+
const sqlStatements = fromJson(filteredEnumsJsonStatements, "postgresql", action);
|
17568
17590
|
const uniqueSqlStatements = [];
|
17569
17591
|
sqlStatements.forEach((ss) => {
|
17570
17592
|
if (!uniqueSqlStatements.includes(ss)) {
|
@@ -28829,6 +28851,7 @@ ${withStyle.errorWarning(
|
|
28829
28851
|
} else {
|
28830
28852
|
policiesToReturn[policy4.name] = {
|
28831
28853
|
...mappedPolicy,
|
28854
|
+
schema: tableConfig.schema ?? "public",
|
28832
28855
|
on: `"${tableConfig.schema ?? "public"}"."${tableConfig.name}"`
|
28833
28856
|
};
|
28834
28857
|
}
|
@@ -29037,9 +29060,10 @@ ${withStyle.errorWarning(
|
|
29037
29060
|
while (end > start && str[end - 1] === char3) --end;
|
29038
29061
|
return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
|
29039
29062
|
};
|
29040
|
-
fromDatabase = async (db, tablesFilter = () => true, schemaFilters, entities, progressCallback) => {
|
29063
|
+
fromDatabase = async (db, tablesFilter = () => true, schemaFilters, entities, progressCallback, tsSchema) => {
|
29041
29064
|
const result = {};
|
29042
29065
|
const views = {};
|
29066
|
+
const policies = {};
|
29043
29067
|
const internals = { tables: {} };
|
29044
29068
|
const where = schemaFilters.map((t) => `n.nspname = '${t}'`).join(" or ");
|
29045
29069
|
const allTables = await db.query(
|
@@ -29165,7 +29189,8 @@ WHERE
|
|
29165
29189
|
}
|
29166
29190
|
}
|
29167
29191
|
}
|
29168
|
-
const
|
29192
|
+
const schemasForLinkedPoliciesInSchema = Object.values(tsSchema?.policies ?? {}).map((it) => it.schema);
|
29193
|
+
const wherePolicies = [...schemaFilters, ...schemasForLinkedPoliciesInSchema].map((t) => `schemaname = '${t}'`).join(" or ");
|
29169
29194
|
const policiesByTable = {};
|
29170
29195
|
const allPolicies = await db.query(`SELECT schemaname, tablename, policyname as name, permissive as "as", roles as to, cmd as for, qual as using, with_check as "withCheck" FROM pg_policies${wherePolicies === "" ? "" : ` WHERE ${wherePolicies}`};`);
|
29171
29196
|
for (const dbPolicy of allPolicies) {
|
@@ -29181,6 +29206,15 @@ WHERE
|
|
29181
29206
|
[dbPolicy.name]: { ...rest, to: parsedTo, withCheck: parsedWithCheck, using: parsedUsing }
|
29182
29207
|
};
|
29183
29208
|
}
|
29209
|
+
if (tsSchema?.policies[dbPolicy.name]) {
|
29210
|
+
policies[dbPolicy.name] = {
|
29211
|
+
...rest,
|
29212
|
+
to: parsedTo,
|
29213
|
+
withCheck: parsedWithCheck,
|
29214
|
+
using: parsedUsing,
|
29215
|
+
on: tsSchema?.policies[dbPolicy.name].on
|
29216
|
+
};
|
29217
|
+
}
|
29184
29218
|
}
|
29185
29219
|
if (progressCallback) {
|
29186
29220
|
progressCallback(
|
@@ -29773,7 +29807,7 @@ WHERE
|
|
29773
29807
|
schemas: schemasObject,
|
29774
29808
|
sequences: sequencesToReturn,
|
29775
29809
|
roles: rolesToReturn,
|
29776
|
-
policies
|
29810
|
+
policies,
|
29777
29811
|
views,
|
29778
29812
|
_meta: {
|
29779
29813
|
schemas: {},
|
@@ -30217,7 +30251,7 @@ var init_blob = __esm({
|
|
30217
30251
|
return "blob";
|
30218
30252
|
}
|
30219
30253
|
mapFromDriverValue(value) {
|
30220
|
-
return BigInt(
|
30254
|
+
return BigInt(value.toString());
|
30221
30255
|
}
|
30222
30256
|
mapToDriverValue(value) {
|
30223
30257
|
return Buffer.from(value.toString());
|
@@ -30242,7 +30276,7 @@ var init_blob = __esm({
|
|
30242
30276
|
return "blob";
|
30243
30277
|
}
|
30244
30278
|
mapFromDriverValue(value) {
|
30245
|
-
return JSON.parse(
|
30279
|
+
return JSON.parse(value.toString());
|
30246
30280
|
}
|
30247
30281
|
mapToDriverValue(value) {
|
30248
30282
|
return Buffer.from(JSON.stringify(value));
|
@@ -34062,25 +34096,6 @@ WHERE
|
|
34062
34096
|
}
|
34063
34097
|
});
|
34064
34098
|
|
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
|
-
|
34084
34099
|
// ../drizzle-orm/dist/mysql-core/alias.js
|
34085
34100
|
var init_alias4 = __esm({
|
34086
34101
|
"../drizzle-orm/dist/mysql-core/alias.js"() {
|
@@ -34703,7 +34718,7 @@ var init_datetime = __esm({
|
|
34703
34718
|
// ../drizzle-orm/dist/mysql-core/columns/decimal.js
|
34704
34719
|
function decimal(a, b = {}) {
|
34705
34720
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34706
|
-
return new MySqlDecimalBuilder(name2, config);
|
34721
|
+
return new MySqlDecimalBuilder(name2, config.precision, config.scale);
|
34707
34722
|
}
|
34708
34723
|
var _a259, _b182, MySqlDecimalBuilder, _a260, _b183, MySqlDecimal;
|
34709
34724
|
var init_decimal = __esm({
|
@@ -34713,11 +34728,10 @@ var init_decimal = __esm({
|
|
34713
34728
|
init_utils2();
|
34714
34729
|
init_common4();
|
34715
34730
|
MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b182) {
|
34716
|
-
constructor(name2,
|
34731
|
+
constructor(name2, precision, scale) {
|
34717
34732
|
super(name2, "string", "MySqlDecimal");
|
34718
|
-
this.config.precision =
|
34719
|
-
this.config.scale =
|
34720
|
-
this.config.unsigned = config?.unsigned;
|
34733
|
+
this.config.precision = precision;
|
34734
|
+
this.config.scale = scale;
|
34721
34735
|
}
|
34722
34736
|
/** @internal */
|
34723
34737
|
build(table4) {
|
@@ -34733,19 +34747,15 @@ var init_decimal = __esm({
|
|
34733
34747
|
super(...arguments);
|
34734
34748
|
__publicField(this, "precision", this.config.precision);
|
34735
34749
|
__publicField(this, "scale", this.config.scale);
|
34736
|
-
__publicField(this, "unsigned", this.config.unsigned);
|
34737
34750
|
}
|
34738
34751
|
getSQLType() {
|
34739
|
-
let type = "";
|
34740
34752
|
if (this.precision !== void 0 && this.scale !== void 0) {
|
34741
|
-
|
34753
|
+
return `decimal(${this.precision},${this.scale})`;
|
34742
34754
|
} else if (this.precision === void 0) {
|
34743
|
-
|
34755
|
+
return "decimal";
|
34744
34756
|
} else {
|
34745
|
-
|
34757
|
+
return `decimal(${this.precision})`;
|
34746
34758
|
}
|
34747
|
-
type = type === "decimal(10,0)" || type === "decimal(10)" ? "decimal" : type;
|
34748
|
-
return this.unsigned ? `${type} unsigned` : type;
|
34749
34759
|
}
|
34750
34760
|
};
|
34751
34761
|
__publicField(MySqlDecimal, _a260, "MySqlDecimal");
|
@@ -34769,7 +34779,6 @@ var init_double = __esm({
|
|
34769
34779
|
super(name2, "number", "MySqlDouble");
|
34770
34780
|
this.config.precision = config?.precision;
|
34771
34781
|
this.config.scale = config?.scale;
|
34772
|
-
this.config.unsigned = config?.unsigned;
|
34773
34782
|
}
|
34774
34783
|
/** @internal */
|
34775
34784
|
build(table4) {
|
@@ -34782,18 +34791,15 @@ var init_double = __esm({
|
|
34782
34791
|
super(...arguments);
|
34783
34792
|
__publicField(this, "precision", this.config.precision);
|
34784
34793
|
__publicField(this, "scale", this.config.scale);
|
34785
|
-
__publicField(this, "unsigned", this.config.unsigned);
|
34786
34794
|
}
|
34787
34795
|
getSQLType() {
|
34788
|
-
let type = "";
|
34789
34796
|
if (this.precision !== void 0 && this.scale !== void 0) {
|
34790
|
-
|
34797
|
+
return `double(${this.precision},${this.scale})`;
|
34791
34798
|
} else if (this.precision === void 0) {
|
34792
|
-
|
34799
|
+
return "double";
|
34793
34800
|
} else {
|
34794
|
-
|
34801
|
+
return `double(${this.precision})`;
|
34795
34802
|
}
|
34796
|
-
return this.unsigned ? `${type} unsigned` : type;
|
34797
34803
|
}
|
34798
34804
|
};
|
34799
34805
|
__publicField(MySqlDouble, _a262, "MySqlDouble");
|
@@ -34843,23 +34849,18 @@ var init_enum2 = __esm({
|
|
34843
34849
|
});
|
34844
34850
|
|
34845
34851
|
// ../drizzle-orm/dist/mysql-core/columns/float.js
|
34846
|
-
function float(
|
34847
|
-
|
34848
|
-
return new MySqlFloatBuilder(name2, config);
|
34852
|
+
function float(name2) {
|
34853
|
+
return new MySqlFloatBuilder(name2 ?? "");
|
34849
34854
|
}
|
34850
34855
|
var _a265, _b188, MySqlFloatBuilder, _a266, _b189, MySqlFloat;
|
34851
34856
|
var init_float = __esm({
|
34852
34857
|
"../drizzle-orm/dist/mysql-core/columns/float.js"() {
|
34853
34858
|
"use strict";
|
34854
34859
|
init_entity();
|
34855
|
-
init_utils2();
|
34856
34860
|
init_common4();
|
34857
34861
|
MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b188) {
|
34858
|
-
constructor(name2
|
34862
|
+
constructor(name2) {
|
34859
34863
|
super(name2, "number", "MySqlFloat");
|
34860
|
-
this.config.precision = config?.precision;
|
34861
|
-
this.config.scale = config?.scale;
|
34862
|
-
this.config.unsigned = config?.unsigned;
|
34863
34864
|
}
|
34864
34865
|
/** @internal */
|
34865
34866
|
build(table4) {
|
@@ -34868,22 +34869,8 @@ var init_float = __esm({
|
|
34868
34869
|
};
|
34869
34870
|
__publicField(MySqlFloatBuilder, _a265, "MySqlFloatBuilder");
|
34870
34871
|
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
|
-
}
|
34877
34872
|
getSQLType() {
|
34878
|
-
|
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;
|
34873
|
+
return "float";
|
34887
34874
|
}
|
34888
34875
|
};
|
34889
34876
|
__publicField(MySqlFloat, _a266, "MySqlFloat");
|
@@ -38875,8 +38862,8 @@ ${withStyle.errorWarning(
|
|
38875
38862
|
changedType = columnType.replace("bigint unsigned", "serial");
|
38876
38863
|
}
|
38877
38864
|
}
|
38878
|
-
if (columnType.
|
38879
|
-
changedType =
|
38865
|
+
if (columnType.startsWith("tinyint")) {
|
38866
|
+
changedType = "tinyint";
|
38880
38867
|
}
|
38881
38868
|
let onUpdate = void 0;
|
38882
38869
|
if (columnType.startsWith("timestamp") && typeof columnExtra !== "undefined" && columnExtra.includes("on update CURRENT_TIMESTAMP")) {
|
@@ -39398,7 +39385,6 @@ var init_utils9 = __esm({
|
|
39398
39385
|
"use strict";
|
39399
39386
|
import_hanji7 = __toESM(require_hanji());
|
39400
39387
|
init_lib();
|
39401
|
-
init_getTablesFilterByExtensions();
|
39402
39388
|
init_global();
|
39403
39389
|
init_schemaValidator();
|
39404
39390
|
init_serializer();
|
@@ -39907,7 +39893,7 @@ init_mjs();
|
|
39907
39893
|
init_global();
|
39908
39894
|
init_pgSerializer();
|
39909
39895
|
init_views();
|
39910
|
-
var pgPushIntrospect = async (db, filters, schemaFilters, entities) => {
|
39896
|
+
var pgPushIntrospect = async (db, filters, schemaFilters, entities, tsSchema) => {
|
39911
39897
|
const matchers = filters.map((it) => {
|
39912
39898
|
return new Minimatch(it);
|
39913
39899
|
});
|
@@ -39935,7 +39921,7 @@ var pgPushIntrospect = async (db, filters, schemaFilters, entities) => {
|
|
39935
39921
|
);
|
39936
39922
|
const res = await (0, import_hanji3.renderWithTask)(
|
39937
39923
|
progress,
|
39938
|
-
fromDatabase(db, filter2, schemaFilters, entities)
|
39924
|
+
fromDatabase(db, filter2, schemaFilters, entities, void 0, tsSchema)
|
39939
39925
|
);
|
39940
39926
|
const schema4 = { id: originUUID, prevId: "", ...res };
|
39941
39927
|
const { internal, ...schemaWithoutInternals } = schema4;
|
@@ -40103,7 +40089,7 @@ var pgSuggestions = async (db, statements) => {
|
|
40103
40089
|
}
|
40104
40090
|
}
|
40105
40091
|
}
|
40106
|
-
const stmnt = fromJson([statement], "postgresql");
|
40092
|
+
const stmnt = fromJson([statement], "postgresql", "push");
|
40107
40093
|
if (typeof stmnt !== "undefined") {
|
40108
40094
|
statementsToExecute.push(...stmnt);
|
40109
40095
|
}
|
@@ -40341,7 +40327,6 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
40341
40327
|
|
40342
40328
|
// src/api.ts
|
40343
40329
|
init_sqlitePushUtils();
|
40344
|
-
init_getTablesFilterByExtensions();
|
40345
40330
|
init_global();
|
40346
40331
|
init_migrationPreparator();
|
40347
40332
|
init_mysqlSchema();
|
@@ -40395,12 +40380,9 @@ var generateMigration = async (prev, cur) => {
|
|
40395
40380
|
);
|
40396
40381
|
return sqlStatements;
|
40397
40382
|
};
|
40398
|
-
var pushSchema = async (imports, drizzleInstance, schemaFilters
|
40383
|
+
var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
40399
40384
|
const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
|
40400
40385
|
const { sql: sql2 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
|
40401
|
-
const filters = (tablesFilter ?? []).concat(
|
40402
|
-
getTablesFilterByExtensions({ extensionsFilters, dialect: "postgresql" })
|
40403
|
-
);
|
40404
40386
|
const db = {
|
40405
40387
|
query: async (query, params) => {
|
40406
40388
|
const res = await drizzleInstance.execute(sql2.raw(query));
|
@@ -40410,7 +40392,7 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters, tablesFilter, e
|
|
40410
40392
|
const cur = generateDrizzleJson(imports);
|
40411
40393
|
const { schema: prev } = await pgPushIntrospect(
|
40412
40394
|
db,
|
40413
|
-
|
40395
|
+
[],
|
40414
40396
|
schemaFilters ?? ["public"],
|
40415
40397
|
void 0
|
40416
40398
|
);
|