Skip to content

Commit

Permalink
Database schema for migration.
Browse files Browse the repository at this point in the history
  • Loading branch information
maisawr committed Feb 21, 2024
1 parent 312ff82 commit 83c146b
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
58 changes: 58 additions & 0 deletions app/schemas/com.example.pa.data.local.PlannerDatabase/2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "d51d399df7ab080ecd2740c20298baa9",
"entities": [
{
"tableName": "tasks_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`task_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_description` TEXT, `start_date_time` TEXT NOT NULL, `end_date` TEXT NOT NULL, `task_complete` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "taskId",
"columnName": "task_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "taskInput",
"columnName": "task_description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "startDate",
"columnName": "start_date_time",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "endDate",
"columnName": "end_date",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isTaskComplete",
"columnName": "task_complete",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"task_id"
]
},
"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, 'd51d399df7ab080ecd2740c20298baa9')"
]
}
}
58 changes: 58 additions & 0 deletions app/schemas/com.example.pa.data.local.PlannerDatabase/3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"formatVersion": 1,
"database": {
"version": 3,
"identityHash": "d51d399df7ab080ecd2740c20298baa9",
"entities": [
{
"tableName": "tasks_table",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`task_id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_description` TEXT, `start_date_time` TEXT NOT NULL, `end_date` TEXT NOT NULL, `task_complete` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "taskId",
"columnName": "task_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "taskInput",
"columnName": "task_description",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "startDate",
"columnName": "start_date_time",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "endDate",
"columnName": "end_date",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isTaskComplete",
"columnName": "task_complete",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"autoGenerate": true,
"columnNames": [
"task_id"
]
},
"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, 'd51d399df7ab080ecd2740c20298baa9')"
]
}
}

0 comments on commit 83c146b

Please sign in to comment.