Skip to content

Commit 7a6a517

Browse files
committed
Fix broken orm test cases
1 parent 4f8c7f1 commit 7a6a517

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

drizzle-orm/tests/casing/mssql-to-camel.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import mssql from 'mssql';
22
import { beforeEach, describe, it } from 'vitest';
3+
import { relations } from '~/_relations';
34
import { alias, bit, int, mssqlSchema, mssqlTable, text, union } from '~/mssql-core';
45
import { drizzle } from '~/node-mssql';
5-
import { relations } from '~/relations';
66
import { asc, eq, sql } from '~/sql';
77

88
const testSchema = mssqlSchema('test');
99
const users = mssqlTable('users', {
10-
id: int().primaryKey().identity(1, 1),
10+
// TODO: Investigate reasons for existence of next commented line
11+
// id: int().primaryKey().identity(1, 1),
12+
id: int().primaryKey().identity({
13+
seed: 1,
14+
increment: 1,
15+
}),
1116
first_name: text().notNull(),
1217
last_name: text().notNull(),
1318
// Test that custom aliases remain
@@ -17,7 +22,9 @@ const usersRelations = relations(users, ({ one }) => ({
1722
developers: one(developers),
1823
}));
1924
const developers = testSchema.table('developers', {
20-
user_id: int().primaryKey().primaryKey().references('name1', () => users.id),
25+
// TODO: Investigate reasons for existence of next commented line
26+
// user_id: int().primaryKey().primaryKey().references('name1', () => users.id),
27+
user_id: int().primaryKey().primaryKey().references(() => users.id),
2128
uses_drizzle_orm: bit().notNull(),
2229
});
2330
const developersRelations = relations(developers, ({ one }) => ({

drizzle-orm/tests/casing/mssql-to-snake.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import mssql from 'mssql';
22
import { beforeEach, describe, it } from 'vitest';
3+
import { relations } from '~/_relations';
34
import { alias, bit, int, mssqlSchema, mssqlTable, text, union } from '~/mssql-core';
45
import { drizzle } from '~/node-mssql';
5-
import { relations } from '~/relations';
66
import { asc, eq, sql } from '~/sql';
77

88
const testSchema = mssqlSchema('test');
99
const users = mssqlTable('users', {
10-
id: int().primaryKey().identity(1, 1),
10+
// TODO: Investigate reasons for existence of next commented line
11+
// id: int().primaryKey().identity(1, 1),
12+
id: int().primaryKey().identity({
13+
seed: 1,
14+
increment: 1,
15+
}),
1116
firstName: text().notNull(),
1217
lastName: text().notNull(),
1318
// Test that custom aliases remain
@@ -17,7 +22,9 @@ const usersRelations = relations(users, ({ one }) => ({
1722
developers: one(developers),
1823
}));
1924
const developers = testSchema.table('developers', {
20-
userId: int().primaryKey().references('name1', () => users.id),
25+
// TODO: Investigate reasons for existence of next commented line
26+
// userId: int().primaryKey().references('name1', () => users.id),
27+
userId: int().primaryKey().references(() => users.id),
2128
usesDrizzleORM: bit().notNull(),
2229
});
2330
const developersRelations = relations(developers, ({ one }) => ({

0 commit comments

Comments
 (0)