-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new table `SourceOrder` to the database for storing the order of sources. This table has columns for source , name, and order. It also adds a UI screen to allow users to reorder sources.
- Loading branch information
jacobrein
committed
Oct 8, 2024
1 parent
eb7ba0f
commit 5d0c3c8
Showing
3 changed files
with
343 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
160 changes: 160 additions & 0 deletions
160
favoritesdatabase/schemas/com.programmersbox.favoritesdatabase.ItemDatabase/3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
{ | ||
"formatVersion": 1, | ||
"database": { | ||
"version": 3, | ||
"identityHash": "6049570df1db4dae3d25b3632e5ae7bb", | ||
"entities": [ | ||
{ | ||
"tableName": "FavoriteItem", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `description` TEXT NOT NULL, `url` TEXT NOT NULL, `imageUrl` TEXT NOT NULL, `sources` TEXT NOT NULL, `numChapters` INTEGER NOT NULL DEFAULT 0, `shouldCheckForUpdate` INTEGER NOT NULL DEFAULT true, PRIMARY KEY(`url`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "title", | ||
"columnName": "title", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "description", | ||
"columnName": "description", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "url", | ||
"columnName": "url", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "imageUrl", | ||
"columnName": "imageUrl", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "source", | ||
"columnName": "sources", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "numChapters", | ||
"columnName": "numChapters", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "shouldCheckForUpdate", | ||
"columnName": "shouldCheckForUpdate", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "true" | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"url" | ||
] | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
}, | ||
{ | ||
"tableName": "ChapterWatched", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `name` TEXT NOT NULL, `favoriteUrl` TEXT NOT NULL, PRIMARY KEY(`url`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "url", | ||
"columnName": "url", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "name", | ||
"columnName": "name", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "favoriteUrl", | ||
"columnName": "favoriteUrl", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"url" | ||
] | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
}, | ||
{ | ||
"tableName": "Notifications", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `url` TEXT NOT NULL, `summaryText` TEXT NOT NULL, `notiTitle` TEXT NOT NULL, `notiPicture` TEXT, `source` TEXT NOT NULL, `contentTitle` TEXT NOT NULL, PRIMARY KEY(`url`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "id", | ||
"columnName": "id", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "url", | ||
"columnName": "url", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "summaryText", | ||
"columnName": "summaryText", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "notiTitle", | ||
"columnName": "notiTitle", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "imageUrl", | ||
"columnName": "notiPicture", | ||
"affinity": "TEXT", | ||
"notNull": false | ||
}, | ||
{ | ||
"fieldPath": "source", | ||
"columnName": "source", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "contentTitle", | ||
"columnName": "contentTitle", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"url" | ||
] | ||
}, | ||
"indices": [], | ||
"foreignKeys": [] | ||
} | ||
], | ||
"views": [], | ||
"setupQueries": [ | ||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '6049570df1db4dae3d25b3632e5ae7bb')" | ||
] | ||
} | ||
} |
182 changes: 182 additions & 0 deletions
182
favoritesdatabase/schemas/com.programmersbox.favoritesdatabase.ItemDatabase/4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
{ | ||
"formatVersion": 1, | ||
"database": { | ||
"version": 4, | ||
"identityHash": "b277778f5e884ca80df37e72924ba0eb", | ||
"entities": [ | ||
{ | ||
"tableName": "FavoriteItem", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `description` TEXT NOT NULL, `url` TEXT NOT NULL, `imageUrl` TEXT NOT NULL, `sources` TEXT NOT NULL, `numChapters` INTEGER NOT NULL DEFAULT 0, `shouldCheckForUpdate` INTEGER NOT NULL DEFAULT true, PRIMARY KEY(`url`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "title", | ||
"columnName": "title", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "description", | ||
"columnName": "description", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "url", | ||
"columnName": "url", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "imageUrl", | ||
"columnName": "imageUrl", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "source", | ||
"columnName": "sources", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "numChapters", | ||
"columnName": "numChapters", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "0" | ||
}, | ||
{ | ||
"fieldPath": "shouldCheckForUpdate", | ||
"columnName": "shouldCheckForUpdate", | ||
"affinity": "INTEGER", | ||
"notNull": true, | ||
"defaultValue": "true" | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"url" | ||
] | ||
} | ||
}, | ||
{ | ||
"tableName": "ChapterWatched", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`url` TEXT NOT NULL, `name` TEXT NOT NULL, `favoriteUrl` TEXT NOT NULL, PRIMARY KEY(`url`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "url", | ||
"columnName": "url", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "name", | ||
"columnName": "name", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "favoriteUrl", | ||
"columnName": "favoriteUrl", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"url" | ||
] | ||
} | ||
}, | ||
{ | ||
"tableName": "Notifications", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `url` TEXT NOT NULL, `summaryText` TEXT NOT NULL, `notiTitle` TEXT NOT NULL, `notiPicture` TEXT, `source` TEXT NOT NULL, `contentTitle` TEXT NOT NULL, PRIMARY KEY(`url`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "id", | ||
"columnName": "id", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "url", | ||
"columnName": "url", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "summaryText", | ||
"columnName": "summaryText", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "notiTitle", | ||
"columnName": "notiTitle", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "imageUrl", | ||
"columnName": "notiPicture", | ||
"affinity": "TEXT" | ||
}, | ||
{ | ||
"fieldPath": "source", | ||
"columnName": "source", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "contentTitle", | ||
"columnName": "contentTitle", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"url" | ||
] | ||
} | ||
}, | ||
{ | ||
"tableName": "SourceOrder", | ||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`source` TEXT NOT NULL, `name` TEXT NOT NULL, `order` INTEGER NOT NULL, PRIMARY KEY(`source`))", | ||
"fields": [ | ||
{ | ||
"fieldPath": "source", | ||
"columnName": "source", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "name", | ||
"columnName": "name", | ||
"affinity": "TEXT", | ||
"notNull": true | ||
}, | ||
{ | ||
"fieldPath": "order", | ||
"columnName": "order", | ||
"affinity": "INTEGER", | ||
"notNull": true | ||
} | ||
], | ||
"primaryKey": { | ||
"autoGenerate": false, | ||
"columnNames": [ | ||
"source" | ||
] | ||
} | ||
} | ||
], | ||
"setupQueries": [ | ||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'b277778f5e884ca80df37e72924ba0eb')" | ||
] | ||
} | ||
} |