forked from simoncozens/kirin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkirin.sql
102 lines (92 loc) · 2.23 KB
/
kirin.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
CREATE TABLE user ( id integer primary key not null,
username varchar(50) NOT NULL unique,
password varchar(40) NOT NULL,
customer integer
);
CREATE TABLE customer ( id integer primary key not null,
forename char(40) ,
surname char(40) ,
org char(80) ,
address char(80) ,
town char(80) ,
county char(80) ,
country char(2) ,
postcode char(10) ,
phone char(20) ,
fax char(20) ,
email char(128) ,
actype char(30) ,
status varchar(8)/*enum('ok','new','suspended','banned','renew') */ default 'new',
dob date ,
billing_email char(128) ,
sms char(20) ,
accountscode char(10),
vatregistration varchar(30),
vatexempt integer
);
CREATE TABLE admin ( id integer primary key not null, user integer, customer integer);
CREATE TABLE invoice (id integer primary key not null,
customer integer,
issued boolean,
issuedate date,
paid boolean,
vatrate integer
);
CREATE TABLE invoicelineitem (
id integer primary key not null,
invoice integer,
description varchar(255),
subscription integer,
cost decimal(5,2)
);
CREATE TABLE package (
id integer primary key not null,
category varchar(255),
name varchar(255),
description text,
cost decimal(5,2),
duration varchar(255)
);
CREATE TABLE package_service (
id integer primary key not null,
package integer,
service integer
);
CREATE TABLE service (
id integer primary key not null,
name varchar(255),
plugin varchar(255),
parameter varchar(255)
);
CREATE TABLE subscription (
id integer primary key not null,
customer integer,
package integer,
expires date
);
CREATE TABLE jobqueue (
id integer primary key not null,
customer integer,
plugin varchar(255),
method varchar(255),
parameters text
);
CREATE TABLE event_log (
id integer primary key not null,
customer integer,
plugin varchar(255),
timestamp date,
event varchar(255),
details varchar(255)
);
CREATE TABLE constraints (
id integer primary key not null,
name varchar(255),
run text
);
CREATE TABLE vatrates (
id integer primary key not null,
rate decimal(5,2),
startdate date,
enddate date
);