Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
d82539b1
Commit
d82539b1
authored
Nov 23, 2016
by
Max Lv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop the table if the database upgrading failed. #987
parent
7922159e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
54 deletions
+64
-54
src/main/scala/com/github/shadowsocks/database/DBHelper.scala
...main/scala/com/github/shadowsocks/database/DBHelper.scala
+64
-54
No files found.
src/main/scala/com/github/shadowsocks/database/DBHelper.scala
View file @
d82539b1
...
...
@@ -46,6 +46,7 @@ import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper
import
com.j256.ormlite.dao.Dao
import
com.j256.ormlite.support.ConnectionSource
import
com.j256.ormlite.table.TableUtils
import
com.github.shadowsocks.ShadowsocksApplication.app
import
scala.collection.JavaConverters._
import
scala.collection.mutable
...
...
@@ -81,6 +82,8 @@ class DBHelper(val context: Context)
onCreate
(
database
,
connectionSource
)
return
}
try
{
if
(
oldVersion
<
8
)
{
profileDao
.
executeRawNoArgs
(
"ALTER TABLE `profile` ADD COLUMN udpdns SMALLINT;"
)
}
...
...
@@ -141,6 +144,13 @@ class DBHelper(val context: Context)
}
else
if
(
oldVersion
<
19
)
{
profileDao
.
executeRawNoArgs
(
"UPDATE `profile` SET kcpPort = 8399 WHERE kcpPort = 0;"
)
}
}
catch
{
case
ex
:
Exception
=>
app
.
track
(
ex
)
profileDao
.
executeRawNoArgs
(
"DROP TABLE IF EXISTS 'profile';"
)
onCreate
(
database
,
connectionSource
)
return
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment