-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
162 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
- 更新备注 | ||
- 替换备案查询接口 | ||
- 优化时间统计 | ||
- 完善问度娘 | ||
- 完善问文档 | ||
|
||
- v1.6.1(2024-01-28) | ||
- 添加网站监控 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@File : migrate_162_to_163.py | ||
@Date : 2023-09-17 | ||
cmd: | ||
$ python domain_admin/migrate/migrate_162_to_163.py | ||
""" | ||
from __future__ import print_function, unicode_literals, absolute_import, division | ||
|
||
from domain_admin.migrate import migrate_common | ||
from domain_admin.model.base_model import db | ||
from domain_admin.model.domain_info_model import DomainInfoModel | ||
from domain_admin.model.domain_model import DomainModel | ||
from domain_admin.model.notify_model import NotifyModel | ||
|
||
|
||
def execute_migrate(): | ||
""" | ||
版本升级 1.6.2 => 1.6.3 | ||
:return: | ||
""" | ||
migrator = migrate_common.get_migrator(db) | ||
|
||
migrate_rows = [ | ||
migrator.add_column( | ||
DomainInfoModel._meta.table_name, | ||
DomainInfoModel.version.name, | ||
DomainInfoModel.version | ||
), | ||
|
||
migrator.add_column( | ||
DomainModel._meta.table_name, | ||
DomainModel.version.name, | ||
DomainModel.version | ||
), | ||
|
||
] | ||
|
||
migrate_common.try_execute_migrate(migrate_rows) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@File : __init__.py.py | ||
@Date : 2024-01-30 | ||
@Author : Peng Shiyu | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
@File : domain_info_model_test.py | ||
@Date : 2024-01-30 | ||
@Author : Peng Shiyu | ||
""" | ||
import unittest | ||
|
||
from peewee import SQL | ||
|
||
from domain_admin.model.domain_info_model import DomainInfoModel | ||
|
||
|
||
class MonitorServiceTest(unittest.TestCase): | ||
def test_add(self): | ||
DomainInfoModel.update( | ||
version=DomainInfoModel.version + 1 | ||
).where( | ||
DomainInfoModel.id == 1 | ||
).execute() | ||
|
||
# ('UPDATE `tb_domain_info` SET `version` = (`tb_domain_info`.`version` + %s) WHERE (`tb_domain_info`.`id` = %s)', [1, 1]) | ||
|
||
def test_order(self): | ||
rows = list(DomainInfoModel.select( | ||
DomainInfoModel.id, DomainInfoModel.create_time | ||
).order_by(SQL("`create_time` desc"))) | ||
|
||
# ('SELECT `t1`.`id`, `t1`.`create_time` FROM `tb_domain_info` AS `t1` ORDER BY `create_time` desc', []) |