forked from avascriptions/open-indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat[tidb]:create table if not exist
- Loading branch information
1 parent
2c2fe28
commit 2bcb45c
Showing
9 changed files
with
149 additions
and
5 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
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,17 @@ | ||
CREATE TABLE IF NOT EXISTS `token_activities` ( | ||
`block_timestamp` datetime(3) NOT NULL COMMENT 'Timestamp of the block containing the inscription (matches block_timestamp in transactions table)', | ||
`block_number` bigint(20) NOT NULL COMMENT 'Block number containing the inscription (matches block_number in transactions table)', | ||
`tx_index` int(11) NOT NULL COMMENT 'Index of the transaction containing the inscription (matches transaction_index in transactions table)', | ||
`tx_hash` varchar(66) NOT NULL COMMENT 'Unique identifier of the transaction containing the inscription (matches hash in transactions table)', | ||
`log_index` int(11) NOT NULL COMMENT 'Index of the log within the transaction', | ||
`type` varchar(255) NOT NULL COMMENT 'mint transfer burn', | ||
`tick` varchar(255) NOT NULL COMMENT 'Token tick', | ||
`id` varchar(255) NOT NULL COMMENT 'Unique identifier of the inscription', | ||
`amt` decimal(38, 0) DEFAULT NULL COMMENT 'Mint amount', | ||
`from_address` varchar(42) DEFAULT NULL COMMENT 'Address sending the inscription (matches from_address in transactions table)', | ||
`to_address` varchar(42) DEFAULT NULL COMMENT 'Address receiving the inscription (match to_address in transactions table)', | ||
PRIMARY KEY ( | ||
`id`, `log_index`, `tx_index`, `tick`, | ||
`type` | ||
) | ||
); |
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,9 @@ | ||
CREATE TABLE `token_balances` ( | ||
`block_number` bigint(20) unsigned DEFAULT NULL COMMENT 'Block number containing the transaction', | ||
`block_timestamp` datetime(3) DEFAULT NULL COMMENT 'Block timestamp containing the transaction', | ||
`tick` varchar(255) NOT NULL COMMENT 'Token tick', | ||
`wallet_address` varchar(42) NOT NULL COMMENT 'Address of owner', | ||
`total_supply` decimal(38, 0) DEFAULT NULL COMMENT 'Max supply', | ||
`amount` decimal(38, 0) DEFAULT NULL COMMENT 'The balance of wallet balance at the corresponding block height', | ||
PRIMARY KEY (`tick`, `wallet_address`) | ||
); |
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,19 @@ | ||
CREATE TABLE IF NOT EXISTS `token_info` ( | ||
`block_timestamp` datetime(3) NOT NULL COMMENT 'Timestamp of the block containing the inscription (matches block_timestamp in transactions table)', | ||
`block_number` bigint(20) NOT NULL COMMENT 'Block number containing the inscription (matches block_number in transactions table)', | ||
`tx_index` int(11) NOT NULL COMMENT 'Index of the transaction containing the inscription (matches transaction_index in transactions table)', | ||
`tx_hash` varchar(66) NOT NULL COMMENT 'Unique identifier of the transaction containing the inscription (matches hash in transactions table)', | ||
`tick` varchar(255) NOT NULL COMMENT 'Token tick', | ||
`max_supply` decimal(38, 0) DEFAULT NULL COMMENT 'Max supply', | ||
`lim` decimal(38, 0) DEFAULT NULL COMMENT 'Limit of each mint', | ||
`wlim` decimal(38, 0) DEFAULT NULL COMMENT 'Limit of each address can maximum mint', | ||
`dec` int(11) DEFAULT NULL COMMENT 'Decimal for minimum divie', | ||
`creator` varchar(42) DEFAULT NULL COMMENT 'Address originating the inscription (matches from_address in transactions table)', | ||
`minted` decimal(38, 0) DEFAULT '0', | ||
`holders` decimal(38, 0) DEFAULT '0', | ||
`txs` decimal(38, 0) DEFAULT '0', | ||
`updated_timestamp` timestamp(3) NULL DEFAULT NULL, | ||
`completed_timestamp` timestamp(3) NULL DEFAULT NULL, | ||
`id` varchar(255) DEFAULT NULL, | ||
PRIMARY KEY (`tick`) | ||
); |
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