@@ -65,7 +65,7 @@ const ExportCommand = cmd({
6565 // Export sessions (organized by projectID)
6666 const sessionDir = path . join ( outDir , "session" )
6767 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( SessionTable ) . all ( ) ) ) {
68- const dir = path . join ( sessionDir , row . projectID )
68+ const dir = path . join ( sessionDir , row . project_id )
6969 await fs . mkdir ( dir , { recursive : true } )
7070 await Bun . write ( path . join ( dir , `${ row . id } .json` ) , JSON . stringify ( Session . fromRow ( row ) , null , 2 ) )
7171 stats . sessions ++
@@ -74,7 +74,7 @@ const ExportCommand = cmd({
7474 // Export messages (organized by sessionID)
7575 const messageDir = path . join ( outDir , "message" )
7676 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( MessageTable ) . all ( ) ) ) {
77- const dir = path . join ( messageDir , row . sessionID )
77+ const dir = path . join ( messageDir , row . session_id )
7878 await fs . mkdir ( dir , { recursive : true } )
7979 await Bun . write ( path . join ( dir , `${ row . id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
8080 stats . messages ++
@@ -83,7 +83,7 @@ const ExportCommand = cmd({
8383 // Export parts (organized by messageID)
8484 const partDir = path . join ( outDir , "part" )
8585 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( PartTable ) . all ( ) ) ) {
86- const dir = path . join ( partDir , row . messageID )
86+ const dir = path . join ( partDir , row . message_id )
8787 await fs . mkdir ( dir , { recursive : true } )
8888 await Bun . write ( path . join ( dir , `${ row . id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
8989 stats . parts ++
@@ -93,39 +93,39 @@ const ExportCommand = cmd({
9393 const diffDir = path . join ( outDir , "session_diff" )
9494 await fs . mkdir ( diffDir , { recursive : true } )
9595 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( SessionDiffTable ) . all ( ) ) ) {
96- await Bun . write ( path . join ( diffDir , `${ row . sessionID } .json` ) , JSON . stringify ( row . data , null , 2 ) )
96+ await Bun . write ( path . join ( diffDir , `${ row . session_id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
9797 stats . diffs ++
9898 }
9999
100100 // Export todos
101101 const todoDir = path . join ( outDir , "todo" )
102102 await fs . mkdir ( todoDir , { recursive : true } )
103103 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( TodoTable ) . all ( ) ) ) {
104- await Bun . write ( path . join ( todoDir , `${ row . sessionID } .json` ) , JSON . stringify ( row . data , null , 2 ) )
104+ await Bun . write ( path . join ( todoDir , `${ row . session_id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
105105 stats . todos ++
106106 }
107107
108108 // Export permissions
109109 const permDir = path . join ( outDir , "permission" )
110110 await fs . mkdir ( permDir , { recursive : true } )
111111 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( PermissionTable ) . all ( ) ) ) {
112- await Bun . write ( path . join ( permDir , `${ row . projectID } .json` ) , JSON . stringify ( row . data , null , 2 ) )
112+ await Bun . write ( path . join ( permDir , `${ row . project_id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
113113 stats . permissions ++
114114 }
115115
116116 // Export session shares
117117 const sessionShareDir = path . join ( outDir , "session_share" )
118118 await fs . mkdir ( sessionShareDir , { recursive : true } )
119119 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( SessionShareTable ) . all ( ) ) ) {
120- await Bun . write ( path . join ( sessionShareDir , `${ row . sessionID } .json` ) , JSON . stringify ( row . data , null , 2 ) )
120+ await Bun . write ( path . join ( sessionShareDir , `${ row . session_id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
121121 stats . sessionShares ++
122122 }
123123
124124 // Export shares
125125 const shareDir = path . join ( outDir , "share" )
126126 await fs . mkdir ( shareDir , { recursive : true } )
127127 for ( const row of Database . use ( ( db ) => db . select ( ) . from ( ShareTable ) . all ( ) ) ) {
128- await Bun . write ( path . join ( shareDir , `${ row . sessionID } .json` ) , JSON . stringify ( row . data , null , 2 ) )
128+ await Bun . write ( path . join ( shareDir , `${ row . session_id } .json` ) , JSON . stringify ( row . data , null , 2 ) )
129129 stats . shares ++
130130 }
131131
0 commit comments