drizzle-kit 0.9.2 → 0.9.6
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/drizzle.js +4 -0
- package/drizzle.js.map +1 -0
- package/package.json +2 -2
- package/.eslintrc +0 -21
- package/config.yml +0 -4
- package/data/_prev/multi.ts +0 -43
- package/data/_prev/tables/authOtpTable.ts +0 -22
- package/data/_prev/tables/cityTable.ts +0 -17
- package/data/_prev/tables/usersTable.ts +0 -18
- package/data/_prev/types/types.ts +0 -11
- package/data/v1/tables/authOtpTable.ts +0 -18
- package/data/v1/tables/deletedTable.ts +0 -9
- package/data/v1/tables/usersTable.ts +0 -15
- package/data/v1/types/types.ts +0 -6
- package/data/v2/tables/authOtpTable.ts +0 -22
- package/data/v2/tables/cityTable.ts +0 -10
- package/data/v2/tables/usersTable.ts +0 -19
- package/data/v2/types/types.ts +0 -11
- package/data/v3/tables/authOtpTable.ts +0 -21
- package/data/v3/tables/cityTable.ts +0 -17
- package/data/v3/tables/usersTable.ts +0 -18
- package/data/v3/types/types.ts +0 -11
- package/dist/drizzle.js +0 -2136
- package/dist/drizzle.js.map +0 -1
- package/dist/package.json +0 -85
- package/factory.ts +0 -224
- package/fstest.ts +0 -50
- package/index.ts +0 -16
- package/readme.md +0 -9
- package/serializer.ts +0 -139
- package/src/cli/commands/migration/index.tsx +0 -10
- package/src/cli/commands/migration/migrate/index.tsx +0 -164
- package/src/cli/components-api/ComponentsList.tsx +0 -20
- package/src/cli/components-api/CreateApp.tsx +0 -19
- package/src/cli/components-api/components/PromptColumnsConflicts.tsx +0 -171
- package/src/cli/components-api/components/PromptTablesConflicts.tsx +0 -180
- package/src/cli/components-api/components/Task.tsx +0 -85
- package/src/cli/components-api/index.tsx +0 -76
- package/src/cli/enq.ts +0 -41
- package/src/cli/index.tsx +0 -8
- package/src/cli/machines/resolveColumnsMachine.ts +0 -179
- package/src/cli/machines/resolveTablesMachine.ts +0 -169
- package/src/cli/utils/formatDataForTable.ts +0 -36
- package/src/cli/utils/valuesForPrompts.ts +0 -35
- package/src/diff.ts +0 -272
- package/src/differ.js +0 -135
- package/src/jsonStatements.js +0 -176
- package/src/migrationPreparator.ts +0 -47
- package/src/serilizer/factory.ts +0 -340
- package/src/serilizer/index.ts +0 -25
- package/src/simulator.ts +0 -85
- package/src/sqlgenerator.js +0 -373
- package/test-build.js +0 -26
- package/test.ts +0 -57
- package/testFactory.js +0 -3
- package/testFactory.ts +0 -26
- package/tsconfig.json +0 -28
- package/webpack.config.js +0 -53
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AbstractTable } from 'drizzle-orm';
|
|
2
|
-
|
|
3
|
-
export default class CitiesTable extends AbstractTable<CitiesTable> {
|
|
4
|
-
public name = this.timestamp('name', { notNull: true }).defaultValue(new Date());
|
|
5
|
-
public data = this.jsonb<string[]>('data');
|
|
6
|
-
|
|
7
|
-
public tableName(): string {
|
|
8
|
-
return 'cities';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbstractTable } from "drizzle-orm";
|
|
2
|
-
|
|
3
|
-
export default class UsersTable extends AbstractTable<UsersTable> {
|
|
4
|
-
public id = this.int('id').autoIncrement().primaryKey();
|
|
5
|
-
public phone = this.varchar('phone', { size: 256 }).unique();
|
|
6
|
-
public fullName = this.varchar('full_name_to_alter', { size: 512 });
|
|
7
|
-
|
|
8
|
-
public createdAt = this.timestamp('created_at', { notNull: true });
|
|
9
|
-
public updatedAt = this.timestamp('updated_at', { notNull: true });
|
|
10
|
-
|
|
11
|
-
public phoneFullNameIndex = this.index([this.phone, this.fullName]);
|
|
12
|
-
|
|
13
|
-
// deleted
|
|
14
|
-
// public fullNameIndex = this.index(this.fullName);
|
|
15
|
-
|
|
16
|
-
public tableName(): string {
|
|
17
|
-
return 'users2';
|
|
18
|
-
}
|
|
19
|
-
}
|
package/data/v2/types/types.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createEnum } from "drizzle-orm/types/type";
|
|
2
|
-
|
|
3
|
-
export const rolesEnum = createEnum({
|
|
4
|
-
alias: "roles_enum",
|
|
5
|
-
values: ["role1", "role2", "role3"],
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const roles2Enum = createEnum({
|
|
9
|
-
alias: "roles2_enum",
|
|
10
|
-
values: ["role1.1", "role2.2", "role3.3"],
|
|
11
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { AbstractTable } from 'drizzle-orm';
|
|
2
|
-
import UsersTable from './usersTable';
|
|
3
|
-
import { rolesEnum } from '../types/types';
|
|
4
|
-
|
|
5
|
-
export default class AuthOtpTable extends AbstractTable<AuthOtpTable> {
|
|
6
|
-
public id = this.int('id').autoIncrement().primaryKey();
|
|
7
|
-
public phone = this.varchar('phone', { size: 256 });
|
|
8
|
-
public otp = this.varchar('otp', { size: 256 });
|
|
9
|
-
public issuedAt = this.timestamp('issued_at', { notNull: true });
|
|
10
|
-
public createdAt = this.timestamp('created_at', { notNull: true });
|
|
11
|
-
public updatedAt = this.timestamp('updated_at', { notNull: true });
|
|
12
|
-
|
|
13
|
-
public roleEnum = this.type(rolesEnum, 'role')
|
|
14
|
-
public userId = this.int('user_id').foreignKey(UsersTable, (table) => table.id);
|
|
15
|
-
|
|
16
|
-
public test = this.jsonb<string[]>('test');
|
|
17
|
-
|
|
18
|
-
public tableName(): string {
|
|
19
|
-
return 'auth_otp';
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { AbstractTable } from 'drizzle-orm';
|
|
2
|
-
import UsersTable from './usersTable';
|
|
3
|
-
import { rolesEnum } from '../types/types';
|
|
4
|
-
|
|
5
|
-
export default class CitiesTable extends AbstractTable<CitiesTable> {
|
|
6
|
-
public name = this.timestamp('name', { notNull: true }).defaultValue(new Date());
|
|
7
|
-
public page = this.varchar('page', { size: 256 });
|
|
8
|
-
public roleEnum = this.type(rolesEnum, 'role')
|
|
9
|
-
|
|
10
|
-
public userId1 = this.int('user_id').foreignKey(UsersTable, (table) => table.id);
|
|
11
|
-
|
|
12
|
-
public data = this.jsonb<string[]>('data');
|
|
13
|
-
|
|
14
|
-
public tableName(): string {
|
|
15
|
-
return 'citiess';
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { AbstractTable } from "drizzle-orm";
|
|
2
|
-
|
|
3
|
-
export default class UsersTable extends AbstractTable<UsersTable> {
|
|
4
|
-
public id = this.int('id').autoIncrement().primaryKey();
|
|
5
|
-
public phone = this.varchar('phone', { size: 256 }).unique();
|
|
6
|
-
public fullName = this.varchar('full_name', { size: 512 });
|
|
7
|
-
public test = this.decimal('test', { notNull: true, precision: 100, scale: 2 });
|
|
8
|
-
public test1 = this.bigint('test1', { notNull: true });
|
|
9
|
-
public createdAt = this.timestamp('created_at', { notNull: true });
|
|
10
|
-
public updatedAt = this.timestamp('updated_at', { notNull: true });
|
|
11
|
-
|
|
12
|
-
public phoneFullNameIndex = this.index([this.phone, this.fullName]);
|
|
13
|
-
public phoneIndex = this.index(this.phone);
|
|
14
|
-
|
|
15
|
-
public tableName(): string {
|
|
16
|
-
return 'users';
|
|
17
|
-
}
|
|
18
|
-
}
|
package/data/v3/types/types.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createEnum } from "drizzle-orm/types/type";
|
|
2
|
-
|
|
3
|
-
export const rolesEnum = createEnum({
|
|
4
|
-
alias: "roles_enum",
|
|
5
|
-
values: ["role1", "role2", "role3"],
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export const roles2Enum = createEnum({
|
|
9
|
-
alias: "roles2_enum",
|
|
10
|
-
values: ["role1.1", "role2.2", "role3.3"],
|
|
11
|
-
});
|