11import Foundation
2- import PowerSync
2+ import PowerSyncSwift
33
44let LISTS_TABLE = " lists "
55let TODOS_TABLE = " todos "
@@ -8,40 +8,32 @@ let lists = Table(
88 name: LISTS_TABLE,
99 columns: [
1010 // ID column is automatically included
11- Column ( name: " name " , type: ColumnType . text) ,
12- Column ( name: " created_at " , type: ColumnType . text) ,
13- Column ( name: " owner_id " , type: ColumnType . text)
14- ] ,
15- indexes: [ ] ,
16- localOnly: false ,
17- insertOnly: false ,
18- viewNameOverride: LISTS_TABLE
11+ . text( " name " ) ,
12+ . text( " created_at " ) ,
13+ . text( " owner_id " )
14+ ]
1915)
2016
2117let todos = Table (
2218 name: TODOS_TABLE,
2319 // ID column is automatically included
2420 columns: [
25- Column ( name : " list_id " , type : ColumnType . text ) ,
26- Column ( name : " photo_id " , type : ColumnType . text ) ,
27- Column ( name : " description " , type : ColumnType . text ) ,
21+ Column . text ( " list_id " ) ,
22+ Column . text ( " photo_id " ) ,
23+ Column . text ( " description " ) ,
2824 // 0 or 1 to represent false or true
29- Column ( name: " completed " , type: ColumnType . integer) ,
30- Column ( name: " created_at " , type: ColumnType . text) ,
31- Column ( name: " completed_at " , type: ColumnType . text) ,
32- Column ( name: " created_by " , type: ColumnType . text) ,
33- Column ( name: " completed_by " , type: ColumnType . text)
34-
25+ Column . integer ( " completed " ) ,
26+ Column . text ( " created_at " ) ,
27+ Column . text ( " completed_at " ) ,
28+ Column . text ( " created_by " ) ,
29+ Column . text ( " completed_by " )
3530 ] ,
3631 indexes: [
3732 Index (
3833 name: " list_id " ,
39- columns: [ IndexedColumn ( column : " list_id " , ascending : true , columnDefinition : nil , type : nil ) ]
34+ columns: [ IndexedColumn . ascending ( " list_id " ) ]
4035 )
41- ] ,
42- localOnly: false ,
43- insertOnly: false ,
44- viewNameOverride: TODOS_TABLE
36+ ]
4537)
4638
47- let AppSchema = Schema ( tables : [ lists, todos] )
39+ let AppSchema = Schema ( lists, todos)
0 commit comments