-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2739 from CounterpartyXCP/develop
v10.7.2-alpha.1
- Loading branch information
Showing
54 changed files
with
6,040 additions
and
5,433 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Empty file.
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
36 changes: 36 additions & 0 deletions
36
counterparty-core/counterpartycore/lib/api/migrations/0016.fix2_asset_longname_field.py
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,36 @@ | ||
# | ||
# file: counterpartycore/lib/api/migrations/0016.fix2_asset_longname_field.py | ||
# | ||
import logging | ||
|
||
from counterpartycore.lib import config | ||
from yoyo import step | ||
|
||
logger = logging.getLogger(config.LOGGER_NAME) | ||
|
||
__depends__ = {"0015.fix_asset_longname_field"} | ||
|
||
|
||
def dict_factory(cursor, row): | ||
fields = [column[0] for column in cursor.description] | ||
return {key: value for key, value in zip(fields, row)} | ||
|
||
|
||
def apply(db): | ||
logger.info("Update `asset_longname` field...") | ||
db.row_factory = dict_factory | ||
|
||
cursor = db.cursor() | ||
cursor.execute("UPDATE fairminters SET asset_longname = NULL WHERE asset_longname = ''") | ||
cursor.execute("UPDATE fairminters SET asset_parent = NULL WHERE asset_parent = ''") | ||
cursor.execute("UPDATE issuances SET asset_longname = NULL WHERE asset_longname = ''") | ||
cursor.execute("UPDATE assets_info SET asset_longname = NULL WHERE asset_longname = ''") | ||
|
||
logger.info("`asset_longname` field updated...") | ||
|
||
|
||
def rollback(db): | ||
pass | ||
|
||
|
||
steps = [step(apply, rollback)] |
10 changes: 10 additions & 0 deletions
10
counterparty-core/counterpartycore/lib/api/migrations/0017.create_events_count_table.sql
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,10 @@ | ||
-- depends: 0016.fix2_asset_longname_field | ||
CREATE TABLE IF NOT EXISTS events_count( | ||
event TEXT PRIMARY KEY, | ||
count INTEGER); | ||
CREATE INDEX IF NOT EXISTS events_count_count_idx ON events_count (count); | ||
|
||
INSERT INTO events_count (event, count) | ||
SELECT event, COUNT(*) AS counter | ||
FROM messages | ||
GROUP BY event; |
Oops, something went wrong.