Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
bf8d56df
Unverified
Commit
bf8d56df
authored
Mar 24, 2020
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔖
发布 v4.0.0
parent
9633eb92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
1 deletion
+76
-1
src/main/java/org/b3log/solo/service/UpgradeService.java
src/main/java/org/b3log/solo/service/UpgradeService.java
+3
-1
src/main/java/org/b3log/solo/upgrade/V390_400.java
src/main/java/org/b3log/solo/upgrade/V390_400.java
+73
-0
No files found.
src/main/java/org/b3log/solo/service/UpgradeService.java
View file @
bf8d56df
...
@@ -31,7 +31,7 @@ import org.json.JSONObject;
...
@@ -31,7 +31,7 @@ import org.json.JSONObject;
* Upgrade service.
* Upgrade service.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.1.1
7, Feb 21
, 2020
* @version 1.2.1.1
8, Mar 24
, 2020
* @since 1.2.0
* @since 1.2.0
*/
*/
@Service
@Service
...
@@ -102,6 +102,8 @@ public class UpgradeService {
...
@@ -102,6 +102,8 @@ public class UpgradeService {
V370_380
.
perform
();
V370_380
.
perform
();
case
"3.8.0"
:
case
"3.8.0"
:
V380_390
.
perform
();
V380_390
.
perform
();
case
"3.9.0"
:
V390_400
.
perform
();
break
;
break
;
default
:
default
:
...
...
src/main/java/org/b3log/solo/upgrade/V390_400.java
0 → 100644
View file @
bf8d56df
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-present, b3log.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package
org
.
b3log
.
solo
.
upgrade
;
import
org.apache.logging.log4j.Level
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.b3log.latke.ioc.BeanManager
;
import
org.b3log.latke.repository.Transaction
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.json.JSONObject
;
/**
* Upgrade script from v3.9.0 to v4.0.0.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.0, Mar 24, 2020
* @since 4.0.0
*/
public
final
class
V390_400
{
/**
* Logger.
*/
private
static
final
Logger
LOGGER
=
LogManager
.
getLogger
(
V390_400
.
class
);
/**
* Performs upgrade from v3.9.0 to v4.0.0.
*
* @throws Exception upgrade fails
*/
public
static
void
perform
()
throws
Exception
{
final
String
fromVer
=
"3.9.0"
;
final
String
toVer
=
"4.0.0"
;
LOGGER
.
log
(
Level
.
INFO
,
"Upgrading from version ["
+
fromVer
+
"] to version ["
+
toVer
+
"]...."
);
final
BeanManager
beanManager
=
BeanManager
.
getInstance
();
final
OptionRepository
optionRepository
=
beanManager
.
getReference
(
OptionRepository
.
class
);
try
{
final
Transaction
transaction
=
optionRepository
.
beginTransaction
();
final
JSONObject
versionOpt
=
optionRepository
.
get
(
Option
.
ID_C_VERSION
);
versionOpt
.
put
(
Option
.
OPTION_VALUE
,
toVer
);
optionRepository
.
update
(
Option
.
ID_C_VERSION
,
versionOpt
);
transaction
.
commit
();
LOGGER
.
log
(
Level
.
INFO
,
"Upgraded from version ["
+
fromVer
+
"] to version ["
+
toVer
+
"] successfully"
);
}
catch
(
final
Exception
e
)
{
LOGGER
.
log
(
Level
.
ERROR
,
"Upgrade failed!"
,
e
);
throw
new
Exception
(
"Upgrade failed from version ["
+
fromVer
+
"] to version ["
+
toVer
+
"]"
);
}
}
}
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