File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ Tracking progress on key features and tasks for the project.
9494
9595Just finished up the database connection, next steps:
9696
97- - [ ] Update schema to show files and folders
98- - [ ] Manually insert examples
97+ - [x ] Update schema to show files and folders
98+ - [x ] Manually insert examples
9999- [ ] Render them in the UI
100100- [ ] Push and make sure it all works
Original file line number Diff line number Diff line change 11import {
22 int ,
3- bigint ,
3+ index ,
44 text ,
5- singlestoreTable ,
5+ singlestoreTableCreator ,
6+ bigint ,
67} from "drizzle-orm/singlestore-core" ;
78
8- export const users = singlestoreTable ( "users_table" , {
9- id : bigint ( "id" , { mode : "bigint" } ) . primaryKey ( ) . autoincrement ( ) ,
10- name : text ( "name" ) ,
11- age : int ( "age" ) ,
12- } ) ;
9+ const createTable = singlestoreTableCreator ( ( name ) => `drive_tutorial_${ name } ` ) ;
10+
11+ export const files = createTable (
12+ "files" ,
13+ {
14+ id : bigint ( "id" , { mode : "number" , unsigned : true } )
15+ . primaryKey ( )
16+ . autoincrement ( ) ,
17+ name : text ( "name" ) . notNull ( ) ,
18+ size : int ( "size" ) . notNull ( ) ,
19+ parent : bigint ( "parent" , { mode : "number" , unsigned : true } ) ,
20+ } ,
21+ ( table ) => [ index ( "parent_index" ) . on ( table . parent ) ] ,
22+ ) ;
23+
24+ export const folders = createTable (
25+ "folders" ,
26+ {
27+ id : bigint ( "id" , { mode : "number" , unsigned : true } )
28+ . primaryKey ( )
29+ . autoincrement ( ) ,
30+ name : text ( "name" ) . notNull ( ) ,
31+ parent : bigint ( "parent" , { mode : "number" , unsigned : true } ) ,
32+ } ,
33+ ( table ) => [ index ( "parent_index" ) . on ( table . parent ) ] ,
34+ ) ;
You can’t perform that action at this time.
0 commit comments