@@ -4,6 +4,7 @@ import 'package:powersync_attachments_helper/powersync_attachments_helper.dart';
44const todosTable = 'todos' ;
55const listsRawTable = 'lists' ;
66
7+ const manualSchemaMngmtMode = true ;
78
89Schema schema = Schema ([
910 const Table (todosTable, [
@@ -19,30 +20,32 @@ Schema schema = Schema([
1920 // Index to allow efficient lookup within a list
2021 Index ('list' , [IndexedColumn ('list_id' )])
2122 ]),
22- // const Table('lists', [
23- // Column.text('created_at'),
24- // Column.text('name'),
25- // Column.text('owner_id')
26- // ]),
23+ if (! manualSchemaMngmtMode)
24+ const Table ('lists' , [
25+ Column .text ('created_at' ),
26+ Column .text ('name' ),
27+ Column .text ('owner_id' )
28+ ]),
2729 AttachmentsQueueTable (
2830 attachmentsQueueTableName: defaultAttachmentsQueueTableName,
2931 ),
3032], rawTables: [
31- RawTable (
32- name: 'lists' ,
33- put: PendingStatement (
34- sql:
35- "INSERT OR REPLACE INTO $listsRawTable (id, created_at, name, owner_id) VALUES (?, ?, ?, ?);" ,
36- params: [
37- PendingStmtValueId (),
38- PendingStmtValueColumn ('created_at' ),
39- PendingStmtValueColumn ('name' ),
40- PendingStmtValueColumn ('owner_id' ),
41- ],
42- ),
43- delete: PendingStatement (
44- sql: "DELETE FROM $listsRawTable WHERE id = ?" ,
45- params: [PendingStmtValueId ()],
46- ),
47- )
33+ if (manualSchemaMngmtMode)
34+ RawTable (
35+ name: 'lists' ,
36+ put: PendingStatement (
37+ sql:
38+ "INSERT OR REPLACE INTO $listsRawTable (id, created_at, name, owner_id) VALUES (?, ?, ?, ?);" ,
39+ params: [
40+ PendingStmtValueId (),
41+ PendingStmtValueColumn ('created_at' ),
42+ PendingStmtValueColumn ('name' ),
43+ PendingStmtValueColumn ('owner_id' ),
44+ ],
45+ ),
46+ delete: PendingStatement (
47+ sql: "DELETE FROM $listsRawTable WHERE id = ?" ,
48+ params: [PendingStmtValueId ()],
49+ ),
50+ )
4851]);
0 commit comments