Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
project8856
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
赵宇轩
project8856
Commits
7716fa7e
Commit
7716fa7e
authored
3 years ago
by
noberumotto
Browse files
Options
Downloads
Patches
Plain Diff
修复升级到1.0.0.3版本数据迁移某些情况下崩溃的问题
parent
96b9075e
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Core/Librarys/SQLite/SQLiteBuilder.cs
+20
-4
20 additions, 4 deletions
Core/Librarys/SQLite/SQLiteBuilder.cs
with
20 additions
and
4 deletions
Core/Librarys/SQLite/SQLiteBuilder.cs
+
20
−
4
View file @
7716fa7e
...
@@ -178,9 +178,10 @@ namespace Core.Librarys.SQLite
...
@@ -178,9 +178,10 @@ namespace Core.Librarys.SQLite
}
}
if
(!
isNew
)
HandleVersion1002Migrate
();
{
HandleVersion1002Migrate
();
}
// 处理表字段删除
// 处理表字段删除
foreach
(
var
dbModel
in
modelInfosDb
)
foreach
(
var
dbModel
in
modelInfosDb
)
...
@@ -278,9 +279,10 @@ namespace Core.Librarys.SQLite
...
@@ -278,9 +279,10 @@ namespace Core.Librarys.SQLite
var
ID
=
rd
[
0
];
var
ID
=
rd
[
0
];
var
Name
=
rd
[
1
].
ToString
();
var
Name
=
rd
[
1
].
ToString
();
var
Description
=
rd
[
2
].
ToString
();
var
Description
=
rd
[
2
].
ToString
();
var
icon
=
Iconer
.
Get
(
Name
,
Description
);
var
icon
=
Iconer
.
Get
(
Name
,
Description
);
Name
=
SQLiteEscape
(
Name
);
sqlList
.
Add
(
$"update DailyLogModels set AppModelID=
{
ID
}
where ProcessName='
{
Name
}
'"
);
sqlList
.
Add
(
$"update DailyLogModels set AppModelID=
{
ID
}
where ProcessName='
{
Name
}
'"
);
sqlList
.
Add
(
$"update HoursLogModels set AppModelID=
{
ID
}
where ProcessName='
{
Name
}
'"
);
sqlList
.
Add
(
$"update HoursLogModels set AppModelID=
{
ID
}
where ProcessName='
{
Name
}
'"
);
sqlList
.
Add
(
$"update AppModels set IconFile='
{
icon
}
' where ID=
{
ID
}
"
);
sqlList
.
Add
(
$"update AppModels set IconFile='
{
icon
}
' where ID=
{
ID
}
"
);
...
@@ -316,6 +318,20 @@ namespace Core.Librarys.SQLite
...
@@ -316,6 +318,20 @@ namespace Core.Librarys.SQLite
}
}
private
string
SQLiteEscape
(
string
str
)
{
str
=
str
.
Replace
(
"/"
,
"//"
);
str
=
str
.
Replace
(
"'"
,
"''"
);
str
=
str
.
Replace
(
"["
,
"/["
);
str
=
str
.
Replace
(
"]"
,
"/]"
);
str
=
str
.
Replace
(
"%"
,
"/%"
);
str
=
str
.
Replace
(
"&"
,
"/&"
);
str
=
str
.
Replace
(
"_"
,
"/_"
);
str
=
str
.
Replace
(
"("
,
"/("
);
str
=
str
.
Replace
(
")"
,
"/)"
);
return
str
;
}
#
region
是否需要处理
#
region
是否需要处理
/// <summary>
/// <summary>
/// 判断是否需要处理数据,比对core程序集版本号
/// 判断是否需要处理数据,比对core程序集版本号
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment