drizzle-kit 0.20.17-8b4d89e → 0.20.17-9053b76
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +57497 -10916
- package/index.d.mts +37 -63
- package/index.d.ts +37 -63
- package/package.json +15 -20
- package/payload.d.mts +987 -18
- package/payload.d.ts +987 -18
- package/payload.js +20000 -36129
- package/payload.mjs +19917 -36021
- package/utils-studio.js +193 -2643
- package/utils-studio.mjs +193 -2643
- package/utils.js +9 -19
- package/utils.mjs +9 -19
- package/@types/utils.d.ts +0 -12
- package/cli/commands/migrate.d.ts +0 -287
- package/cli/commands/mysqlIntrospect.d.ts +0 -55
- package/cli/commands/mysqlPushUtils.d.ts +0 -14
- package/cli/commands/pgIntrospect.d.ts +0 -59
- package/cli/commands/pgPushUtils.d.ts +0 -11
- package/cli/commands/sqliteIntrospect.d.ts +0 -104
- package/cli/commands/sqlitePushUtils.d.ts +0 -15
- package/cli/commands/utils.d.ts +0 -58
- package/cli/selector-ui.d.ts +0 -13
- package/cli/utils.d.ts +0 -12
- package/cli/validations/cli.d.ts +0 -169
- package/cli/validations/common.d.ts +0 -214
- package/cli/validations/mysql.d.ts +0 -35
- package/cli/validations/outputs.d.ts +0 -41
- package/cli/validations/pg.d.ts +0 -37
- package/cli/validations/sqlite.d.ts +0 -34
- package/cli/views.d.ts +0 -63
- package/global.d.ts +0 -6
- package/introspect-sqlite.d.ts +0 -10
- package/jsonDiffer.d.ts +0 -61
- package/jsonStatements.d.ts +0 -376
- package/migrationPreparator.d.ts +0 -35
- package/schemaValidator.d.ts +0 -1316
- package/serializer/index.d.ts +0 -9
- package/serializer/mysqlImports.d.ts +0 -7
- package/serializer/mysqlSchema.d.ts +0 -4964
- package/serializer/mysqlSerializer.d.ts +0 -7
- package/serializer/pgImports.d.ts +0 -11
- package/serializer/pgSchema.d.ts +0 -4792
- package/serializer/pgSerializer.d.ts +0 -7
- package/serializer/schemaToDrizzle.d.ts +0 -7
- package/serializer/sqliteImports.d.ts +0 -7
- package/serializer/sqliteSchema.d.ts +0 -2801
- package/serializer/sqliteSerializer.d.ts +0 -6
- package/snapshotsDiffer.d.ts +0 -3937
- package/sqlgenerator.d.ts +0 -33
- package/utils/words.d.ts +0 -7
- package/utils-studio.d.mts +0 -4
- package/utils-studio.d.ts +0 -4
- package/utils.d.ts +0 -72
@@ -1,41 +0,0 @@
|
|
1
|
-
export declare const withStyle: {
|
2
|
-
error: (str: string) => string;
|
3
|
-
warning: (str: string) => string;
|
4
|
-
errorWarning: (str: string) => string;
|
5
|
-
fullWarning: (str: string) => string;
|
6
|
-
suggestion: (str: string) => string;
|
7
|
-
};
|
8
|
-
export declare const outputs: {
|
9
|
-
studio: {
|
10
|
-
drivers: (param: string) => string;
|
11
|
-
noCredentials: () => string;
|
12
|
-
noDriver: () => string;
|
13
|
-
noDialect: () => string;
|
14
|
-
};
|
15
|
-
common: {
|
16
|
-
ambiguousParams: (command: string) => string;
|
17
|
-
schema: (command: string) => string;
|
18
|
-
schemaConfig: (command: string) => string;
|
19
|
-
};
|
20
|
-
postgres: {
|
21
|
-
connection: {
|
22
|
-
driver: () => string;
|
23
|
-
required: () => string;
|
24
|
-
};
|
25
|
-
};
|
26
|
-
mysql: {
|
27
|
-
connection: {
|
28
|
-
driver: () => string;
|
29
|
-
required: () => string;
|
30
|
-
};
|
31
|
-
};
|
32
|
-
sqlite: {
|
33
|
-
connection: {
|
34
|
-
driver: () => string;
|
35
|
-
url: (driver: string) => string;
|
36
|
-
authToken: (driver: string) => string;
|
37
|
-
};
|
38
|
-
introspect: {};
|
39
|
-
push: {};
|
40
|
-
};
|
41
|
-
};
|
package/cli/validations/pg.d.ts
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
import { TypeOf } from "zod";
|
2
|
-
export declare const postgresCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
|
3
|
-
driver: import("zod").ZodLiteral<"pg">;
|
4
|
-
host: import("zod").ZodString;
|
5
|
-
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
6
|
-
user: import("zod").ZodDefault<import("zod").ZodString>;
|
7
|
-
password: import("zod").ZodOptional<import("zod").ZodString>;
|
8
|
-
database: import("zod").ZodString;
|
9
|
-
ssl: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
10
|
-
}, "strip", import("zod").ZodTypeAny, {
|
11
|
-
driver: "pg";
|
12
|
-
host: string;
|
13
|
-
user: string;
|
14
|
-
database: string;
|
15
|
-
port?: number | undefined;
|
16
|
-
password?: string | undefined;
|
17
|
-
ssl?: boolean | undefined;
|
18
|
-
}, {
|
19
|
-
driver: "pg";
|
20
|
-
host: string;
|
21
|
-
database: string;
|
22
|
-
port?: number | undefined;
|
23
|
-
user?: string | undefined;
|
24
|
-
password?: string | undefined;
|
25
|
-
ssl?: boolean | undefined;
|
26
|
-
}>, import("zod").ZodObject<{
|
27
|
-
driver: import("zod").ZodLiteral<"pg">;
|
28
|
-
connectionString: import("zod").ZodString;
|
29
|
-
}, "strip", import("zod").ZodTypeAny, {
|
30
|
-
driver: "pg";
|
31
|
-
connectionString: string;
|
32
|
-
}, {
|
33
|
-
driver: "pg";
|
34
|
-
connectionString: string;
|
35
|
-
}>]>;
|
36
|
-
export type PostgresCredentials = TypeOf<typeof postgresCredentials>;
|
37
|
-
export declare const printConfigConnectionIssues: (options: Record<string, unknown>) => void;
|
@@ -1,34 +0,0 @@
|
|
1
|
-
import { TypeOf } from "zod";
|
2
|
-
export declare const sqliteCredentials: import("zod").ZodUnion<[import("zod").ZodObject<{
|
3
|
-
driver: import("zod").ZodLiteral<"turso">;
|
4
|
-
url: import("zod").ZodString;
|
5
|
-
authToken: import("zod").ZodString;
|
6
|
-
}, "strip", import("zod").ZodTypeAny, {
|
7
|
-
url: string;
|
8
|
-
driver: "turso";
|
9
|
-
authToken: string;
|
10
|
-
}, {
|
11
|
-
url: string;
|
12
|
-
driver: "turso";
|
13
|
-
authToken: string;
|
14
|
-
}>, import("zod").ZodObject<{
|
15
|
-
driver: import("zod").ZodLiteral<"better-sqlite">;
|
16
|
-
url: import("zod").ZodString;
|
17
|
-
}, "strip", import("zod").ZodTypeAny, {
|
18
|
-
url: string;
|
19
|
-
driver: "better-sqlite";
|
20
|
-
}, {
|
21
|
-
url: string;
|
22
|
-
driver: "better-sqlite";
|
23
|
-
}>, import("zod").ZodObject<{
|
24
|
-
driver: import("zod").ZodLiteral<"libsql">;
|
25
|
-
url: import("zod").ZodString;
|
26
|
-
}, "strip", import("zod").ZodTypeAny, {
|
27
|
-
url: string;
|
28
|
-
driver: "libsql";
|
29
|
-
}, {
|
30
|
-
url: string;
|
31
|
-
driver: "libsql";
|
32
|
-
}>]>;
|
33
|
-
export type SqliteCredentials = TypeOf<typeof sqliteCredentials>;
|
34
|
-
export declare const printConfigConnectionIssues: (options: Record<string, unknown>) => void;
|
package/cli/views.d.ts
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
import { Prompt, TaskView } from "hanji";
|
2
|
-
import type { CommonSchema } from "../schemaValidator";
|
3
|
-
import type { Named, NamedWithSchema } from "./commands/migrate";
|
4
|
-
export declare const warning: (msg: string) => void;
|
5
|
-
export declare const err: (msg: string) => void;
|
6
|
-
export declare const info: (msg: string, greyMsg?: string) => string;
|
7
|
-
export declare const error: (error: string, greyMsg?: string) => string;
|
8
|
-
export declare const schema: (schema: CommonSchema) => string;
|
9
|
-
export interface RenamePropmtItem<T> {
|
10
|
-
from: T;
|
11
|
-
to: T;
|
12
|
-
}
|
13
|
-
export declare const isRenamePromptItem: <T extends Named>(item: RenamePropmtItem<T> | T) => item is RenamePropmtItem<T>;
|
14
|
-
export declare class ResolveColumnSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
|
15
|
-
private readonly tableName;
|
16
|
-
private readonly base;
|
17
|
-
private readonly data;
|
18
|
-
constructor(tableName: string, base: Named, data: (RenamePropmtItem<T> | T)[]);
|
19
|
-
render(status: "idle" | "submitted" | "aborted"): string;
|
20
|
-
result(): RenamePropmtItem<T> | T;
|
21
|
-
}
|
22
|
-
export declare const tableKey: (it: NamedWithSchema) => string;
|
23
|
-
export declare class ResolveSelect<T extends NamedWithSchema> extends Prompt<RenamePropmtItem<T> | T> {
|
24
|
-
private readonly base;
|
25
|
-
private readonly entityType;
|
26
|
-
private readonly state;
|
27
|
-
constructor(base: T, data: (RenamePropmtItem<T> | T)[], entityType: "table" | "enum");
|
28
|
-
render(status: "idle" | "submitted" | "aborted"): string;
|
29
|
-
result(): RenamePropmtItem<T> | T;
|
30
|
-
}
|
31
|
-
export declare class ResolveSchemasSelect<T extends Named> extends Prompt<RenamePropmtItem<T> | T> {
|
32
|
-
private readonly base;
|
33
|
-
private readonly state;
|
34
|
-
constructor(base: Named, data: (RenamePropmtItem<T> | T)[]);
|
35
|
-
render(status: "idle" | "submitted" | "aborted"): string;
|
36
|
-
result(): RenamePropmtItem<T> | T;
|
37
|
-
}
|
38
|
-
export type IntrospectStatus = "fetching" | "done";
|
39
|
-
export type IntrospectStage = "tables" | "columns" | "enums" | "indexes" | "fks";
|
40
|
-
export declare class IntrospectProgress extends TaskView {
|
41
|
-
private readonly spinner;
|
42
|
-
private timeout;
|
43
|
-
private state;
|
44
|
-
constructor();
|
45
|
-
update(stage: IntrospectStage, count: number, status: IntrospectStatus): void;
|
46
|
-
private formatCount;
|
47
|
-
private statusText;
|
48
|
-
render(): string;
|
49
|
-
}
|
50
|
-
export declare class DropMigrationView<T extends {
|
51
|
-
tag: string;
|
52
|
-
}> extends Prompt<T> {
|
53
|
-
private readonly data;
|
54
|
-
constructor(data: T[]);
|
55
|
-
render(status: "idle" | "submitted" | "aborted"): string;
|
56
|
-
result(): T;
|
57
|
-
}
|
58
|
-
export declare const trimmedRange: <T>(arr: T[], index: number, limitLines: number) => {
|
59
|
-
trimmed: T[];
|
60
|
-
offset: number;
|
61
|
-
startTrimmed: boolean;
|
62
|
-
endTrimmed: boolean;
|
63
|
-
};
|
package/global.d.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
export declare const originUUID = "00000000-0000-0000-0000-000000000000";
|
2
|
-
export declare const snapshotVersion = "6";
|
3
|
-
export declare function assertUnreachable(x: never): never;
|
4
|
-
export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
|
5
|
-
export declare const mapKeys: <T>(obj: Record<string, T>, map: (key: string, value: T) => string) => Record<string, T>;
|
6
|
-
export declare const mapEntries: <T>(obj: Record<string, T>, map: (key: string, value: T) => [string, T]) => Record<string, T>;
|
package/introspect-sqlite.d.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import "./@types/utils";
|
2
|
-
import type { Casing } from "./cli/validations/common";
|
3
|
-
import type { SQLiteSchemaInternal } from "./serializer/sqliteSchema";
|
4
|
-
export declare const indexName: (tableName: string, columns: string[]) => string;
|
5
|
-
export declare const schemaToTypeScript: (schema: SQLiteSchemaInternal, casing: Casing) => {
|
6
|
-
file: string;
|
7
|
-
imports: string;
|
8
|
-
decalrations: string;
|
9
|
-
schemaEntry: string;
|
10
|
-
};
|
package/jsonDiffer.d.ts
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
export function diffForRenamedTables(pairs: any): any;
|
2
|
-
export function diffForRenamedColumn(t1: any, t2: any): any;
|
3
|
-
export function diffSchemasOrTables(left: any, right: any): {
|
4
|
-
added: any[];
|
5
|
-
deleted: any[];
|
6
|
-
};
|
7
|
-
export function diffColumns(left: any, right: any): {
|
8
|
-
[k: string]: any;
|
9
|
-
};
|
10
|
-
export function applyJsonDiff(json1: any, json2: any): {
|
11
|
-
alteredTablesWithColumns: {
|
12
|
-
name: any;
|
13
|
-
schema: any;
|
14
|
-
altered: any[];
|
15
|
-
addedIndexes: {
|
16
|
-
[k: string]: any;
|
17
|
-
};
|
18
|
-
deletedIndexes: {
|
19
|
-
[k: string]: any;
|
20
|
-
};
|
21
|
-
alteredIndexes: {
|
22
|
-
[k: string]: any;
|
23
|
-
};
|
24
|
-
addedForeignKeys: {
|
25
|
-
[k: string]: any;
|
26
|
-
};
|
27
|
-
deletedForeignKeys: {
|
28
|
-
[k: string]: any;
|
29
|
-
};
|
30
|
-
alteredForeignKeys: {
|
31
|
-
[k: string]: any;
|
32
|
-
};
|
33
|
-
addedCompositePKs: {
|
34
|
-
[k: string]: any;
|
35
|
-
};
|
36
|
-
deletedCompositePKs: {
|
37
|
-
[k: string]: any;
|
38
|
-
};
|
39
|
-
alteredCompositePKs: {
|
40
|
-
[k: string]: any;
|
41
|
-
};
|
42
|
-
addedUniqueConstraints: {
|
43
|
-
[k: string]: any;
|
44
|
-
};
|
45
|
-
deletedUniqueConstraints: {
|
46
|
-
[k: string]: any;
|
47
|
-
};
|
48
|
-
alteredUniqueConstraints: {
|
49
|
-
[k: string]: any;
|
50
|
-
};
|
51
|
-
}[];
|
52
|
-
alteredEnums: {
|
53
|
-
name: any;
|
54
|
-
schema: any;
|
55
|
-
addedValues: {
|
56
|
-
before: any;
|
57
|
-
value: any;
|
58
|
-
}[];
|
59
|
-
deletedValues: any[];
|
60
|
-
}[];
|
61
|
-
};
|
package/jsonStatements.d.ts
DELETED
@@ -1,376 +0,0 @@
|
|
1
|
-
import { CommonSquashedSchema } from "./schemaValidator";
|
2
|
-
import { MySqlSchema } from "./serializer/mysqlSchema";
|
3
|
-
import { PgSchema } from "./serializer/pgSchema";
|
4
|
-
import { AlteredColumn, Column, Table } from "./snapshotsDiffer";
|
5
|
-
export interface JsonSqliteCreateTableStatement {
|
6
|
-
type: "sqlite_create_table";
|
7
|
-
tableName: string;
|
8
|
-
columns: Column[];
|
9
|
-
referenceData: string[];
|
10
|
-
compositePKs: string[][];
|
11
|
-
uniqueConstraints?: string[];
|
12
|
-
}
|
13
|
-
export interface JsonCreateTableStatement {
|
14
|
-
type: "create_table";
|
15
|
-
tableName: string;
|
16
|
-
schema: string;
|
17
|
-
columns: Column[];
|
18
|
-
compositePKs: string[];
|
19
|
-
compositePkName?: string;
|
20
|
-
uniqueConstraints?: string[];
|
21
|
-
}
|
22
|
-
export interface JsonDropTableStatement {
|
23
|
-
type: "drop_table";
|
24
|
-
tableName: string;
|
25
|
-
schema: string;
|
26
|
-
}
|
27
|
-
export interface JsonRenameTableStatement {
|
28
|
-
type: "rename_table";
|
29
|
-
fromSchema: string;
|
30
|
-
toSchema: string;
|
31
|
-
tableNameFrom: string;
|
32
|
-
tableNameTo: string;
|
33
|
-
}
|
34
|
-
export interface JsonCreateEnumStatement {
|
35
|
-
type: "create_type_enum";
|
36
|
-
name: string;
|
37
|
-
schema: string;
|
38
|
-
values: string[];
|
39
|
-
}
|
40
|
-
export interface JsonDropEnumStatement {
|
41
|
-
type: "drop_type_enum";
|
42
|
-
name: string;
|
43
|
-
schema: string;
|
44
|
-
}
|
45
|
-
export interface JsonMoveEnumStatement {
|
46
|
-
type: "move_type_enum";
|
47
|
-
name: string;
|
48
|
-
schemaFrom: string;
|
49
|
-
schemaTo: string;
|
50
|
-
}
|
51
|
-
export interface JsonRenameEnumStatement {
|
52
|
-
type: "rename_type_enum";
|
53
|
-
nameFrom: string;
|
54
|
-
nameTo: string;
|
55
|
-
schema: string;
|
56
|
-
}
|
57
|
-
export interface JsonAddValueToEnumStatement {
|
58
|
-
type: "alter_type_add_value";
|
59
|
-
name: string;
|
60
|
-
schema: string;
|
61
|
-
value: string;
|
62
|
-
before: string;
|
63
|
-
}
|
64
|
-
export interface JsonDropColumnStatement {
|
65
|
-
type: "alter_table_drop_column";
|
66
|
-
tableName: string;
|
67
|
-
columnName: string;
|
68
|
-
schema: string;
|
69
|
-
}
|
70
|
-
export interface JsonAddColumnStatement {
|
71
|
-
type: "alter_table_add_column";
|
72
|
-
tableName: string;
|
73
|
-
column: Column;
|
74
|
-
schema: string;
|
75
|
-
}
|
76
|
-
export interface JsonSqliteAddColumnStatement {
|
77
|
-
type: "sqlite_alter_table_add_column";
|
78
|
-
tableName: string;
|
79
|
-
column: Column;
|
80
|
-
referenceData?: string;
|
81
|
-
}
|
82
|
-
export interface JsonCreateIndexStatement {
|
83
|
-
type: "create_index";
|
84
|
-
tableName: string;
|
85
|
-
data: string;
|
86
|
-
schema: string;
|
87
|
-
}
|
88
|
-
export interface JsonReferenceStatement {
|
89
|
-
type: "create_reference" | "alter_reference" | "delete_reference";
|
90
|
-
data: string;
|
91
|
-
schema: string;
|
92
|
-
tableName: string;
|
93
|
-
}
|
94
|
-
export interface JsonCreateUniqueConstraint {
|
95
|
-
type: "create_unique_constraint";
|
96
|
-
tableName: string;
|
97
|
-
data: string;
|
98
|
-
schema?: string;
|
99
|
-
constraintName?: string;
|
100
|
-
}
|
101
|
-
export interface JsonDeleteUniqueConstraint {
|
102
|
-
type: "delete_unique_constraint";
|
103
|
-
tableName: string;
|
104
|
-
data: string;
|
105
|
-
schema?: string;
|
106
|
-
constraintName?: string;
|
107
|
-
}
|
108
|
-
export interface JsonAlterUniqueConstraint {
|
109
|
-
type: "alter_unique_constraint";
|
110
|
-
tableName: string;
|
111
|
-
old: string;
|
112
|
-
new: string;
|
113
|
-
schema?: string;
|
114
|
-
oldConstraintName?: string;
|
115
|
-
newConstraintName?: string;
|
116
|
-
}
|
117
|
-
export interface JsonCreateCompositePK {
|
118
|
-
type: "create_composite_pk";
|
119
|
-
tableName: string;
|
120
|
-
data: string;
|
121
|
-
schema?: string;
|
122
|
-
constraintName?: string;
|
123
|
-
}
|
124
|
-
export interface JsonDeleteCompositePK {
|
125
|
-
type: "delete_composite_pk";
|
126
|
-
tableName: string;
|
127
|
-
data: string;
|
128
|
-
schema?: string;
|
129
|
-
constraintName?: string;
|
130
|
-
}
|
131
|
-
export interface JsonAlterCompositePK {
|
132
|
-
type: "alter_composite_pk";
|
133
|
-
tableName: string;
|
134
|
-
old: string;
|
135
|
-
new: string;
|
136
|
-
schema?: string;
|
137
|
-
oldConstraintName?: string;
|
138
|
-
newConstraintName?: string;
|
139
|
-
}
|
140
|
-
export interface JsonAlterTableSetSchema {
|
141
|
-
type: "alter_table_set_schema";
|
142
|
-
tableName: string;
|
143
|
-
schemaFrom: string;
|
144
|
-
schemaTo: string;
|
145
|
-
}
|
146
|
-
export interface JsonAlterTableRemoveFromSchema {
|
147
|
-
type: "alter_table_remove_from_schema";
|
148
|
-
tableName: string;
|
149
|
-
schema: string;
|
150
|
-
}
|
151
|
-
export interface JsonAlterTableSetNewSchema {
|
152
|
-
type: "alter_table_set_new_schema";
|
153
|
-
tableName: string;
|
154
|
-
from: string;
|
155
|
-
to: string;
|
156
|
-
}
|
157
|
-
export interface JsonCreateReferenceStatement extends JsonReferenceStatement {
|
158
|
-
type: "create_reference";
|
159
|
-
}
|
160
|
-
export interface JsonAlterReferenceStatement extends JsonReferenceStatement {
|
161
|
-
type: "alter_reference";
|
162
|
-
oldFkey: string;
|
163
|
-
}
|
164
|
-
export interface JsonDeleteReferenceStatement extends JsonReferenceStatement {
|
165
|
-
type: "delete_reference";
|
166
|
-
}
|
167
|
-
export interface JsonDropIndexStatement {
|
168
|
-
type: "drop_index";
|
169
|
-
tableName: string;
|
170
|
-
data: string;
|
171
|
-
schema: string;
|
172
|
-
}
|
173
|
-
export interface JsonRenameColumnStatement {
|
174
|
-
type: "alter_table_rename_column";
|
175
|
-
tableName: string;
|
176
|
-
oldColumnName: string;
|
177
|
-
newColumnName: string;
|
178
|
-
schema: string;
|
179
|
-
}
|
180
|
-
export interface JsonAlterColumnTypeStatement {
|
181
|
-
type: "alter_table_alter_column_set_type";
|
182
|
-
tableName: string;
|
183
|
-
columnName: string;
|
184
|
-
newDataType: string;
|
185
|
-
oldDataType: string;
|
186
|
-
schema: string;
|
187
|
-
columnDefault: string;
|
188
|
-
columnOnUpdate: boolean;
|
189
|
-
columnNotNull: boolean;
|
190
|
-
columnAutoIncrement: boolean;
|
191
|
-
columnPk: boolean;
|
192
|
-
}
|
193
|
-
export interface JsonAlterColumnSetPrimaryKeyStatement {
|
194
|
-
type: "alter_table_alter_column_set_pk";
|
195
|
-
tableName: string;
|
196
|
-
schema: string;
|
197
|
-
columnName: string;
|
198
|
-
}
|
199
|
-
export interface JsonAlterColumnDropPrimaryKeyStatement {
|
200
|
-
type: "alter_table_alter_column_drop_pk";
|
201
|
-
tableName: string;
|
202
|
-
columnName: string;
|
203
|
-
schema: string;
|
204
|
-
}
|
205
|
-
export interface JsonAlterColumnSetDefaultStatement {
|
206
|
-
type: "alter_table_alter_column_set_default";
|
207
|
-
tableName: string;
|
208
|
-
columnName: string;
|
209
|
-
newDefaultValue: any;
|
210
|
-
oldDefaultValue?: any;
|
211
|
-
schema: string;
|
212
|
-
newDataType: string;
|
213
|
-
columnOnUpdate: boolean;
|
214
|
-
columnNotNull: boolean;
|
215
|
-
columnAutoIncrement: boolean;
|
216
|
-
columnPk: boolean;
|
217
|
-
}
|
218
|
-
export interface JsonAlterColumnDropDefaultStatement {
|
219
|
-
type: "alter_table_alter_column_drop_default";
|
220
|
-
tableName: string;
|
221
|
-
columnName: string;
|
222
|
-
schema: string;
|
223
|
-
newDataType: string;
|
224
|
-
columnDefault: string;
|
225
|
-
columnOnUpdate: boolean;
|
226
|
-
columnNotNull: boolean;
|
227
|
-
columnAutoIncrement: boolean;
|
228
|
-
columnPk: boolean;
|
229
|
-
}
|
230
|
-
export interface JsonAlterColumnSetNotNullStatement {
|
231
|
-
type: "alter_table_alter_column_set_notnull";
|
232
|
-
tableName: string;
|
233
|
-
columnName: string;
|
234
|
-
schema: string;
|
235
|
-
newDataType: string;
|
236
|
-
columnDefault: string;
|
237
|
-
columnOnUpdate: boolean;
|
238
|
-
columnNotNull: boolean;
|
239
|
-
columnAutoIncrement: boolean;
|
240
|
-
columnPk: boolean;
|
241
|
-
}
|
242
|
-
export interface JsonAlterColumnDropNotNullStatement {
|
243
|
-
type: "alter_table_alter_column_drop_notnull";
|
244
|
-
tableName: string;
|
245
|
-
columnName: string;
|
246
|
-
schema: string;
|
247
|
-
newDataType: string;
|
248
|
-
columnDefault: string;
|
249
|
-
columnOnUpdate: boolean;
|
250
|
-
columnNotNull: boolean;
|
251
|
-
columnAutoIncrement: boolean;
|
252
|
-
columnPk: boolean;
|
253
|
-
}
|
254
|
-
export interface JsonAlterColumnSetOnUpdateStatement {
|
255
|
-
type: "alter_table_alter_column_set_on_update";
|
256
|
-
tableName: string;
|
257
|
-
columnName: string;
|
258
|
-
schema: string;
|
259
|
-
newDataType: string;
|
260
|
-
columnDefault: string;
|
261
|
-
columnOnUpdate: boolean;
|
262
|
-
columnNotNull: boolean;
|
263
|
-
columnAutoIncrement: boolean;
|
264
|
-
columnPk: boolean;
|
265
|
-
}
|
266
|
-
export interface JsonAlterColumnDropOnUpdateStatement {
|
267
|
-
type: "alter_table_alter_column_drop_on_update";
|
268
|
-
tableName: string;
|
269
|
-
columnName: string;
|
270
|
-
schema: string;
|
271
|
-
newDataType: string;
|
272
|
-
columnDefault: string;
|
273
|
-
columnOnUpdate: boolean;
|
274
|
-
columnNotNull: boolean;
|
275
|
-
columnAutoIncrement: boolean;
|
276
|
-
columnPk: boolean;
|
277
|
-
}
|
278
|
-
export interface JsonAlterColumnSetAutoincrementStatement {
|
279
|
-
type: "alter_table_alter_column_set_autoincrement";
|
280
|
-
tableName: string;
|
281
|
-
columnName: string;
|
282
|
-
schema: string;
|
283
|
-
newDataType: string;
|
284
|
-
columnDefault: string;
|
285
|
-
columnOnUpdate: boolean;
|
286
|
-
columnNotNull: boolean;
|
287
|
-
columnAutoIncrement: boolean;
|
288
|
-
columnPk: boolean;
|
289
|
-
}
|
290
|
-
export interface JsonAlterColumnDropAutoincrementStatement {
|
291
|
-
type: "alter_table_alter_column_drop_autoincrement";
|
292
|
-
tableName: string;
|
293
|
-
columnName: string;
|
294
|
-
schema: string;
|
295
|
-
newDataType: string;
|
296
|
-
columnDefault: string;
|
297
|
-
columnOnUpdate: boolean;
|
298
|
-
columnNotNull: boolean;
|
299
|
-
columnAutoIncrement: boolean;
|
300
|
-
columnPk: boolean;
|
301
|
-
}
|
302
|
-
export interface JsonCreateSchema {
|
303
|
-
type: "create_schema";
|
304
|
-
name: string;
|
305
|
-
}
|
306
|
-
export interface JsonDropSchema {
|
307
|
-
type: "drop_schema";
|
308
|
-
name: string;
|
309
|
-
}
|
310
|
-
export interface JsonRenameSchema {
|
311
|
-
type: "rename_schema";
|
312
|
-
from: string;
|
313
|
-
to: string;
|
314
|
-
}
|
315
|
-
export type JsonAlterColumnStatement = JsonRenameColumnStatement | JsonAlterColumnTypeStatement | JsonAlterColumnSetDefaultStatement | JsonAlterColumnDropDefaultStatement | JsonAlterColumnSetNotNullStatement | JsonAlterColumnDropNotNullStatement | JsonAlterColumnDropOnUpdateStatement | JsonAlterColumnSetOnUpdateStatement | JsonAlterColumnDropAutoincrementStatement | JsonAlterColumnSetAutoincrementStatement | JsonAlterColumnSetPrimaryKeyStatement | JsonAlterColumnDropPrimaryKeyStatement;
|
316
|
-
export type JsonStatement = JsonAlterColumnStatement | JsonCreateTableStatement | JsonDropTableStatement | JsonRenameTableStatement | JsonCreateEnumStatement | JsonDropEnumStatement | JsonMoveEnumStatement | JsonRenameEnumStatement | JsonAddValueToEnumStatement | JsonDropColumnStatement | JsonAddColumnStatement | JsonCreateIndexStatement | JsonCreateReferenceStatement | JsonAlterReferenceStatement | JsonDeleteReferenceStatement | JsonDropIndexStatement | JsonReferenceStatement | JsonSqliteCreateTableStatement | JsonSqliteAddColumnStatement | JsonCreateCompositePK | JsonDeleteCompositePK | JsonAlterCompositePK | JsonCreateUniqueConstraint | JsonDeleteUniqueConstraint | JsonAlterUniqueConstraint | JsonCreateSchema | JsonDropSchema | JsonRenameSchema | JsonAlterTableSetSchema | JsonAlterTableRemoveFromSchema | JsonAlterTableSetNewSchema;
|
317
|
-
export declare const preparePgCreateTableJson: (table: Table, json2: PgSchema) => JsonCreateTableStatement;
|
318
|
-
export declare const prepareMySqlCreateTableJson: (table: Table, json2: MySqlSchema) => JsonCreateTableStatement;
|
319
|
-
export declare const prepareSQLiteCreateTable: (table: Table) => JsonSqliteCreateTableStatement;
|
320
|
-
export declare const prepareDropTableJson: (table: Table) => JsonDropTableStatement;
|
321
|
-
export declare const prepareRenameTableJson: (tableFrom: Table, tableTo: Table) => JsonRenameTableStatement;
|
322
|
-
export declare const prepareCreateEnumJson: (name: string, schema: string, values: string[]) => JsonCreateEnumStatement;
|
323
|
-
export declare const prepareAddValuesToEnumJson: (name: string, schema: string, values: {
|
324
|
-
value: string;
|
325
|
-
before: string;
|
326
|
-
}[]) => JsonAddValueToEnumStatement[];
|
327
|
-
export declare const prepareDropEnumJson: (name: string, schema: string) => JsonDropEnumStatement;
|
328
|
-
export declare const prepareMoveEnumJson: (name: string, schemaFrom: string, schemaTo: string) => JsonMoveEnumStatement;
|
329
|
-
export declare const prepareRenameEnumJson: (nameFrom: string, nameTo: string, schema: string) => JsonRenameEnumStatement;
|
330
|
-
export declare const prepareCreateSchemasJson: (values: string[]) => JsonCreateSchema[];
|
331
|
-
export declare const prepareRenameSchemasJson: (values: {
|
332
|
-
from: string;
|
333
|
-
to: string;
|
334
|
-
}[]) => JsonRenameSchema[];
|
335
|
-
export declare const prepareDeleteSchemasJson: (values: string[]) => JsonDropSchema[];
|
336
|
-
export declare const prepareRenameColumns: (tableName: string, schema: string, pairs: {
|
337
|
-
from: Column;
|
338
|
-
to: Column;
|
339
|
-
}[]) => JsonRenameColumnStatement[];
|
340
|
-
export declare const _prepareDropColumns: (taleName: string, schema: string, columns: Column[]) => JsonDropColumnStatement[];
|
341
|
-
export declare const _prepareAddColumns: (tableName: string, schema: string, columns: Column[]) => JsonAddColumnStatement[];
|
342
|
-
export declare const prepareAlterColumnsMysql: (tableName: string, schema: string, columns: AlteredColumn[], json2: CommonSquashedSchema) => JsonAlterColumnStatement[];
|
343
|
-
export declare const preparePgAlterColumns: (_tableName: string, schema: string, columns: AlteredColumn[], json2: CommonSquashedSchema) => JsonAlterColumnStatement[];
|
344
|
-
export declare const prepareSqliteAlterColumns: (tableName: string, schema: string, columns: AlteredColumn[], json2: CommonSquashedSchema) => JsonAlterColumnStatement[];
|
345
|
-
export declare const prepareCreateIndexesJson: (tableName: string, schema: string, indexes: Record<string, string>) => JsonCreateIndexStatement[];
|
346
|
-
export declare const prepareCreateReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonCreateReferenceStatement[];
|
347
|
-
export declare const prepareDropReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, string>) => JsonDeleteReferenceStatement[];
|
348
|
-
export declare const prepareAlterReferencesJson: (tableName: string, schema: string, foreignKeys: Record<string, {
|
349
|
-
__old: string;
|
350
|
-
__new: string;
|
351
|
-
}>) => JsonReferenceStatement[];
|
352
|
-
export declare const prepareDropIndexesJson: (tableName: string, schema: string, indexes: Record<string, string>) => JsonDropIndexStatement[];
|
353
|
-
export declare const prepareAddCompositePrimaryKeySqlite: (tableName: string, pks: Record<string, string>) => JsonCreateCompositePK[];
|
354
|
-
export declare const prepareDeleteCompositePrimaryKeySqlite: (tableName: string, pks: Record<string, string>) => JsonDeleteCompositePK[];
|
355
|
-
export declare const prepareAlterCompositePrimaryKeySqlite: (tableName: string, pks: Record<string, {
|
356
|
-
__old: string;
|
357
|
-
__new: string;
|
358
|
-
}>) => JsonAlterCompositePK[];
|
359
|
-
export declare const prepareAddCompositePrimaryKeyPg: (tableName: string, schema: string, pks: Record<string, string>, json2: PgSchema) => JsonCreateCompositePK[];
|
360
|
-
export declare const prepareDeleteCompositePrimaryKeyPg: (tableName: string, schema: string, pks: Record<string, string>, json1: PgSchema) => JsonDeleteCompositePK[];
|
361
|
-
export declare const prepareAlterCompositePrimaryKeyPg: (tableName: string, schema: string, pks: Record<string, {
|
362
|
-
__old: string;
|
363
|
-
__new: string;
|
364
|
-
}>, json1: PgSchema, json2: PgSchema) => JsonAlterCompositePK[];
|
365
|
-
export declare const prepareAddUniqueConstraintPg: (tableName: string, schema: string, unqs: Record<string, string>) => JsonCreateUniqueConstraint[];
|
366
|
-
export declare const prepareDeleteUniqueConstraintPg: (tableName: string, schema: string, unqs: Record<string, string>) => JsonDeleteUniqueConstraint[];
|
367
|
-
export declare const prepareAlterUniqueConstraintPg: (tableName: string, schema: string, unqs: Record<string, {
|
368
|
-
__old: string;
|
369
|
-
__new: string;
|
370
|
-
}>) => JsonAlterUniqueConstraint[];
|
371
|
-
export declare const prepareAddCompositePrimaryKeyMySql: (tableName: string, pks: Record<string, string>, json1: MySqlSchema, json2: MySqlSchema) => JsonCreateCompositePK[];
|
372
|
-
export declare const prepareDeleteCompositePrimaryKeyMySql: (tableName: string, pks: Record<string, string>, json1: MySqlSchema) => JsonDeleteCompositePK[];
|
373
|
-
export declare const prepareAlterCompositePrimaryKeyMySql: (tableName: string, pks: Record<string, {
|
374
|
-
__old: string;
|
375
|
-
__new: string;
|
376
|
-
}>, json1: MySqlSchema, json2: MySqlSchema) => JsonAlterCompositePK[];
|
package/migrationPreparator.d.ts
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
import { PgSchema, PgSchemaInternal } from "./serializer/pgSchema";
|
2
|
-
import { SQLiteSchema } from "./serializer/sqliteSchema";
|
3
|
-
import { MySqlSchema } from "./serializer/mysqlSchema";
|
4
|
-
export declare const prepareMySqlDbPushSnapshot: (prev: MySqlSchema, schemaPath: string | string[]) => Promise<{
|
5
|
-
prev: MySqlSchema;
|
6
|
-
cur: MySqlSchema;
|
7
|
-
}>;
|
8
|
-
export declare const prepareSQLiteDbPushSnapshot: (prev: SQLiteSchema, schemaPath: string | string[]) => Promise<{
|
9
|
-
prev: SQLiteSchema;
|
10
|
-
cur: SQLiteSchema;
|
11
|
-
}>;
|
12
|
-
export declare const preparePgDbPushSnapshot: (prev: PgSchema, schemaPath: string | string[], schemaFilter?: string[]) => Promise<{
|
13
|
-
prev: PgSchema;
|
14
|
-
cur: PgSchema;
|
15
|
-
}>;
|
16
|
-
export declare const prepareMySqlMigrationSnapshot: (migrationFolders: string[], schemaPath: string | string[]) => Promise<{
|
17
|
-
prev: MySqlSchema;
|
18
|
-
cur: MySqlSchema;
|
19
|
-
custom: MySqlSchema;
|
20
|
-
}>;
|
21
|
-
export declare const prepareSqliteMigrationSnapshot: (snapshots: string[], schemaPath: string | string[]) => Promise<{
|
22
|
-
prev: SQLiteSchema;
|
23
|
-
cur: SQLiteSchema;
|
24
|
-
custom: SQLiteSchema;
|
25
|
-
}>;
|
26
|
-
export declare const fillPgSnapshot: ({ serialized, id, idPrev, }: {
|
27
|
-
serialized: PgSchemaInternal;
|
28
|
-
id: string;
|
29
|
-
idPrev: string;
|
30
|
-
}) => PgSchema;
|
31
|
-
export declare const preparePgMigrationSnapshot: (snapshots: string[], schemaPath: string | string[]) => Promise<{
|
32
|
-
prev: PgSchema;
|
33
|
-
cur: PgSchema;
|
34
|
-
custom: PgSchema;
|
35
|
-
}>;
|