-
Notifications
You must be signed in to change notification settings - Fork 0
/
createsqlcoin3.sql
88 lines (76 loc) · 2.84 KB
/
createsqlcoin3.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema sqlcoin
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema sqlcoin
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `sqlcoin` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;
USE `sqlcoin` ;
-- -----------------------------------------------------
-- Table `sqlcoin`.`blocks`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sqlcoin`.`blocks` (
`height` INT(11) NOT NULL AUTO_INCREMENT,
`hash` VARCHAR(64) NULL,
`prevHash` VARCHAR(64) NULL,
`merkle` VARCHAR(64) NULL,
`timestamp` BIGINT(20) NULL DEFAULT NULL,
PRIMARY KEY (`height`),
UNIQUE INDEX `height_UNIQUE` (`height` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `sqlcoin`.`inputs`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sqlcoin`.`inputs` (
`inID` INT(11) NOT NULL AUTO_INCREMENT,
`txHash` VARCHAR(64) NULL,
`prevTxHash` VARCHAR(64) NULL,
`prevTxIndex` INT NULL,
PRIMARY KEY (`inID`),
UNIQUE INDEX `inID_UNIQUE` (`inID` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `sqlcoin`.`outputs`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sqlcoin`.`outputs` (
`outID` INT(11) NOT NULL AUTO_INCREMENT,
`txHash` VARCHAR(64) NULL,
`txIndex` INT(11) NULL,
`amount` BIGINT(20) NULL DEFAULT NULL,
`address` VARCHAR(59) NULL,
`used` BIGINT(20) NULL DEFAULT NULL,
PRIMARY KEY (`outID`),
UNIQUE INDEX `outID_UNIQUE` (`outID` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
-- -----------------------------------------------------
-- Table `sqlcoin`.`txs`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `sqlcoin`.`txs` (
`txID` INT(11) NOT NULL AUTO_INCREMENT,
`hash` VARCHAR(64) NULL,
`blockHeight` INT(11) NULL,
PRIMARY KEY (`txID`),
UNIQUE INDEX `txID_UNIQUE` (`txID` ASC))
ENGINE = InnoDB
AUTO_INCREMENT = 0
DEFAULT CHARACTER SET = utf8mb4
COLLATE = utf8mb4_0900_ai_ci;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;