@@ -17,14 +17,16 @@ import { regions } from "./regions";
1717export const instances = mysqlTable (
1818 "instances" ,
1919 {
20- pk : bigint ( "pk" , { mode : "number" , unsigned : true } ) . autoincrement ( ) . primaryKey ( ) ,
20+ pk : bigint ( "pk" , { mode : "number" , unsigned : true } )
21+ . autoincrement ( )
22+ . primaryKey ( ) ,
2123 id : varchar ( "id" , { length : 64 } ) . notNull ( ) . unique ( ) ,
2224 deploymentId : varchar ( "deployment_id" , { length : 255 } ) . notNull ( ) ,
2325 workspaceId : varchar ( "workspace_id" , { length : 255 } ) . notNull ( ) ,
2426 projectId : varchar ( "project_id" , { length : 255 } ) . notNull ( ) ,
2527 appId : varchar ( "app_id" , { length : 64 } ) . notNull ( ) ,
2628
27- // region: varchar("region", { length: 64 }).notNull(),
29+ region : varchar ( "region" , { length : 64 } ) . notNull ( ) ,
2830 regionId : varchar ( "region_id" , { length : 64 } ) . notNull ( ) . default ( "TODO" ) ,
2931
3032 // used to apply updates from the kubernetes watch events
@@ -33,7 +35,12 @@ export const instances = mysqlTable(
3335 address : varchar ( "address" , { length : 255 } ) . notNull ( ) ,
3436 cpuMillicores : int ( "cpu_millicores" ) . notNull ( ) ,
3537 memoryMib : int ( "memory_mib" ) . notNull ( ) ,
36- status : mysqlEnum ( "status" , [ "inactive" , "pending" , "running" , "failed" ] ) . notNull ( ) ,
38+ status : mysqlEnum ( "status" , [
39+ "inactive" ,
40+ "pending" ,
41+ "running" ,
42+ "failed" ,
43+ ] ) . notNull ( ) ,
3744 } ,
3845 ( table ) => [
3946 uniqueIndex ( "unique_address_per_region" ) . on ( table . address , table . regionId ) ,
0 commit comments