Repository navigation
Expand file tree
/
Copy pathschema.mysql.sql
More file actions
73 lines (68 loc) · 2.68 KB
/
Copy pathschema.mysql.sql
File metadata and controls
73 lines (68 loc) · 2.68 KB
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
DROP DATABASE `gocontacts`;
CREATE DATABASE `gocontacts`;
USE `gocontacts`;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` timestamp NULL DEFAULT NULL,
`logged_out_at` timestamp NULL DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`role` varchar(255) DEFAULT NULL,
`state` varchar(16) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_users_email` (`email`),
KEY `idx_users_deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
CREATE TABLE `sign_up_confirmations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` timestamp NULL DEFAULT NULL,
`nonce` varchar(32) NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nonce` (`nonce`),
FOREIGN KEY (user_id)
REFERENCES users(id)
ON DELETE CASCADE,
KEY `idx_contacts_user_id` (`user_id`),
KEY `idx_contacts_deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
CREATE TABLE `contacts` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` timestamp NULL DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (user_id)
REFERENCES users(id)
ON DELETE CASCADE,
KEY `idx_contacts_user_id` (`user_id`),
KEY `idx_contacts_deleted_at` (`deleted_at`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
CREATE TABLE `card_transactions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
`datetime` timestamp DEFAULT CURRENT_TIMESTAMP,
`amount` BIGINT NOT NULL,
`currency_scale` TINYINT NOT NULL,
`currency_code` varchar(255) NOT NULL,
`reference` varchar(255) NOT NULL,
`merchant_name` varchar(255) NOT NULL,
`merchant_city` varchar(255) NOT NULL,
`merchant_country_code` varchar(255) NOT NULL,
`merchant_country_name` varchar(255) NOT NULL,
`merchant_category_code` varchar(255) NOT NULL,
`merchant_category_name` varchar(255) NOT NULL,
`user_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`id`),
FOREIGN KEY (user_id)
REFERENCES users(id)
ON DELETE CASCADE,
KEY `idx_contacts_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;