github.com/square/finch@v0.0.0-20240412205204-6530c03e2b96/benchmarks/xfer/trx/schema.sql (about)

     1  
     2  CREATE TABLE customers (
     3    id		bigint         NOT NULL AUTO_INCREMENT,
     4    c_token	varbinary(255) NOT NULL,
     5    country	char(3)        NOT NULL,
     6    c1 		varchar(20)    DEFAULT NULL,
     7    c2 		varchar(50)    DEFAULT NULL,
     8    c3 		varchar(255)   DEFAULT NULL,
     9    b1 		tinyint        NOT NULL,
    10    created_at	timestamp      NOT NULL DEFAULT CURRENT_TIMESTAMP,
    11    updated_at	timestamp      NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    12    PRIMARY KEY (id),
    13    UNIQUE KEY  (c_token),
    14    KEY         (country)
    15  ) ENGINE=InnoDB;
    16  
    17  CREATE TABLE balances (
    18    id 		bigint         NOT NULL AUTO_INCREMENT,
    19    b_token	varbinary(255) NOT NULL,
    20    c_token 	varbinary(255) NOT NULL,
    21    version 	int            NOT NULL DEFAULT '0',
    22    cents 	bigint         NOT NULL,
    23    currency	varbinary(3)   NOT NULL,
    24    c1		varchar(50)    NOT NULL,
    25    c2		varchar(120)   DEFAULT NULL,
    26    b1 		tinyint        NOT NULL,
    27    created_at	timestamp      NOT NULL DEFAULT CURRENT_TIMESTAMP,
    28    updated_at	timestamp      NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    29    PRIMARY KEY (id),
    30    UNIQUE KEY  (b_token),
    31    KEY         (c_token)
    32  ) ENGINE=InnoDB;
    33  
    34  CREATE TABLE xfers (
    35    id		bigint       NOT NULL AUTO_INCREMENT,
    36    x_token	varchar(255) NOT NULL,
    37    cents 	bigint       NOT NULL,
    38    currency 	varbinary(3) NOT NULL,
    39    s_token 	varchar(255) NOT NULL,
    40    r_token 	varchar(255) NOT NULL,
    41    version       int unsigned NOT NULL DEFAULT '0',
    42    c1		varchar(50)           DEFAULT NULL,
    43    c2		varchar(255)          DEFAULT NULL,
    44    c3 		varchar(30)           DEFAULT NULL,
    45    t1 		timestamp        NULL DEFAULT NULL,
    46    t2 		timestamp        NULL DEFAULT NULL,
    47    t3 		timestamp        NULL DEFAULT NULL,
    48    b1 		tinyint      NOT NULL,
    49    b2 		tinyint      NOT NULL,
    50    created_at	timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP,
    51    updated_at	timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    52    PRIMARY KEY 	(id),
    53    UNIQUE KEY  	(x_token),
    54    KEY    	(s_token, t1),
    55    KEY  		(r_token, t1),
    56    KEY    	(created_at)
    57  ) ENGINE=InnoDB;