"createSql":"CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dnsName` TEXT NOT NULL, `type` INTEGER NOT NULL, `records` TEXT NOT NULL, PRIMARY KEY(`dnsName`, `type`))",
"fields":[
{
"fieldPath":"dnsName",
"columnName":"dnsName",
"affinity":"TEXT",
"notNull":true
},
{
"fieldPath":"type",
"columnName":"type",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"records",
"columnName":"records",
"affinity":"TEXT",
"notNull":true
}
],
"primaryKey":{
"columnNames":[
"dnsName",
"type"
],
"autoGenerate":false
},
"indices":[],
"foreignKeys":[]
},
{
"tableName":"DnsQuery",
"createSql":"CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` INTEGER NOT NULL, `name` TEXT NOT NULL, `askedServer` TEXT, `fromCache` INTEGER NOT NULL, `questionTime` INTEGER NOT NULL, `responseTime` INTEGER NOT NULL, `responses` TEXT NOT NULL)",
"fields":[
{
"fieldPath":"id",
"columnName":"id",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"type",
"columnName":"type",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"name",
"columnName":"name",
"affinity":"TEXT",
"notNull":true
},
{
"fieldPath":"askedServer",
"columnName":"askedServer",
"affinity":"TEXT",
"notNull":false
},
{
"fieldPath":"fromCache",
"columnName":"fromCache",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"questionTime",
"columnName":"questionTime",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"responseTime",
"columnName":"responseTime",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"responses",
"columnName":"responses",
"affinity":"TEXT",
"notNull":true
}
],
"primaryKey":{
"columnNames":[
"id"
],
"autoGenerate":true
},
"indices":[],
"foreignKeys":[]
},
{
"tableName":"DnsRule",
"createSql":"CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` INTEGER NOT NULL, `host` TEXT NOT NULL, `ttl` INTEGER NOT NULL, `record` TEXT NOT NULL)",
"fields":[
{
"fieldPath":"id",
"columnName":"id",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"type",
"columnName":"type",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"host",
"columnName":"host",
"affinity":"TEXT",
"notNull":true
},
{
"fieldPath":"ttl",
"columnName":"ttl",
"affinity":"INTEGER",
"notNull":true
},
{
"fieldPath":"record",
"columnName":"record",
"affinity":"TEXT",
"notNull":true
}
],
"primaryKey":{
"columnNames":[
"id"
],
"autoGenerate":true
},
"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, '2e8ac76ac9e86bb1cdf9d82108b12c8e')"
it.execSQL("CREATE TABLE IF NOT EXISTS `DnsQuery` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` INTEGER NOT NULL, `name` TEXT NOT NULL, `askedServer` TEXT, `fromCache` INTEGER NOT NULL, `questionTime` INTEGER NOT NULL, `responseTime` INTEGER NOT NULL, `responses` TEXT NOT NULL)")
Logger.logIfOpen("DB_MIGRATION","Migration from 3 to 4 completed")
}
privatevalMIGRATION_4_5=migration(4,5){
privatevalMIGRATION_4_5=migration(4,5){
Logger.logIfOpen("DB_MIGRATION","Migrating from 4 to 5")
it.execSQL("DROP TABLE IF EXISTS UserServerConfiguration")
it.execSQL("DROP TABLE IF EXISTS UserServerConfiguration")
Logger.logIfOpen("DB_MIGRATION","Migration from 4 to 5 completed")
}
privatevalMIGRATION_5_6=migration(5,6){
Logger.logIfOpen("DB_MIGRATION","Migrating from 5 to 6")
it.execSQL("CREATE TABLE IF NOT EXISTS `DnsRule` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `type` INTEGER NOT NULL, `host` TEXT NOT NULL, `ttl` INTEGER NOT NULL, `record` TEXT NOT NULL)")
Logger.logIfOpen("DB_MIGRATION","Migration from 5 to 6 completed")