1
1
import mssql from 'mssql' ;
2
2
import { beforeEach , describe , it } from 'vitest' ;
3
+ import { relations } from '~/_relations' ;
3
4
import { alias , bit , int , mssqlSchema , mssqlTable , text , union } from '~/mssql-core' ;
4
5
import { drizzle } from '~/node-mssql' ;
5
- import { relations } from '~/relations' ;
6
6
import { asc , eq , sql } from '~/sql' ;
7
7
8
8
const testSchema = mssqlSchema ( 'test' ) ;
9
9
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
+ } ) ,
11
16
first_name : text ( ) . notNull ( ) ,
12
17
last_name : text ( ) . notNull ( ) ,
13
18
// Test that custom aliases remain
@@ -17,7 +22,9 @@ const usersRelations = relations(users, ({ one }) => ({
17
22
developers : one ( developers ) ,
18
23
} ) ) ;
19
24
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 ) ,
21
28
uses_drizzle_orm : bit ( ) . notNull ( ) ,
22
29
} ) ;
23
30
const developersRelations = relations ( developers , ( { one } ) => ( {
0 commit comments