forked from Pushjet/Pushjet-Server-Api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysql-database.sql
82 lines (71 loc) · 2.95 KB
/
mysql-database.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
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';
-- -----------------------------------------------------
-- Table `subscription`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `subscription`;
CREATE TABLE IF NOT EXISTS `subscription` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`device` VARCHAR(40) NOT NULL,
`service_id` INT(10) UNSIGNED NOT NULL,
`last_read` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`timestamp_checked` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
-- -----------------------------------------------------
-- Table `message`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE IF NOT EXISTS `message` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`service_id` INT(10) UNSIGNED NOT NULL,
`text` TEXT NOT NULL,
`title` VARCHAR(255) NULL DEFAULT NULL,
`level` TINYINT(4) NOT NULL DEFAULT '0',
`link` TEXT NULL,
`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
-- -----------------------------------------------------
-- Table `service`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `service`;
CREATE TABLE IF NOT EXISTS `service` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`secret` VARCHAR(32) NOT NULL,
`public` VARCHAR(40) NOT NULL,
`name` VARCHAR(255) NOT NULL,
`icon` TEXT NULL,
`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
-- -----------------------------------------------------
-- Table `gcm`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `gcm`;
CREATE TABLE IF NOT EXISTS `gcm` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`uuid` VARCHAR(40) NOT NULL,
`gcmid` TEXT NOT NULL,
`pubkey` TEXT DEFAULT NULL,
`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`rsa_pub` BLOB(1024) DEFAULT NULL,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
SET SQL_MODE = @OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS = @OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS = @OLD_UNIQUE_CHECKS;