-
Notifications
You must be signed in to change notification settings - Fork 0
/
spark_bitcoin_sms_mysql_seed.sql
105 lines (88 loc) · 2.67 KB
/
spark_bitcoin_sms_mysql_seed.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
use SparkBitcoinSms;
drop table if exists Users;
CREATE TABLE Users (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR (50),
phoneNumber VARCHAR (25),
balance BIGINT UNSIGNED,
recoveryPassword VARCHAR (50),
bitcoinAddress VARCHAR(40),
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
index (phoneNumber),
index (bitcoinAddress),
PRIMARY KEY (id)
);
drop table if exists UnconfirmedUsers;
CREATE TABLE UnconfirmedUsers (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR (50),
phoneNumber VARCHAR (25),
balance BIGINT UNSIGNED,
recoveryPassword VARCHAR (50),
confirmationCode VARCHAR(20),
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
index (phoneNumber),
PRIMARY KEY (id)
);
drop table if exists UnconfirmedTransfers;
CREATE TABLE UnconfirmedTransfers (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
phoneNumberTo VARCHAR (25),
phoneNumberFrom VARCHAR (25),
amount BIGINT UNSIGNED,
confirmationCode VARCHAR(20),
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
index (phoneNumberTo),
index (phoneNumberFrom),
PRIMARY KEY (id)
);
drop table if exists Transfers;
CREATE TABLE Transfers (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
phoneNumberTo VARCHAR (25),
phoneNumberFrom VARCHAR (25),
amount BIGINT UNSIGNED,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
index (phoneNumberTo),
index (phoneNumberFrom),
PRIMARY KEY (id)
);
drop table if exists UnconfirmedWithdrawals;
CREATE TABLE UnconfirmedWithdrawals (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
phoneNumber VARCHAR (25),
amount BIGINT UNSIGNED,
confirmationCode VARCHAR(20),
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
index (phoneNumber),
PRIMARY KEY (id)
);
drop table if exists Withdrawals;
CREATE TABLE Withdrawals (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
phoneNumber VARCHAR (25),
amount BIGINT UNSIGNED,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP,
index (phoneNumber),
PRIMARY KEY (id)
);
drop table if exists TrustedUsers;
CREATE TABLE TrustedUsers (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
phoneNumber VARCHAR (25),
index (phoneNumber),
PRIMARY KEY (id)
);
drop table if exists Wallets;
CREATE TABLE Wallets (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
userId BIGINT UNSIGNED NOT NULL,
index (userId),
PRIMARY KEY (id)
);