File size: 996 Bytes
9697ede
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* oxlint-disable */
export interface UpgradeResult {
  newDb: boolean
}

export const MIGRATIONS_TABLE_VERSIONS = {
  sqlite: 1,
  pg: 1,
  effect: 1,
  mysql: 1,
  mssql: 1,
  cockroach: 1,
  singlestore: 1,
} as const

export const GET_VERSION_FOR = {
  mysql: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
  pg: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
  effect: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
  mssql: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
  cockroach: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
  singlestore: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
  sqlite: (columns: string[]): number => {
    if (columns.includes("name")) return 1
    return 0
  },
} as const