-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgnudip.pgsql
More file actions
78 lines (68 loc) · 2.47 KB
/
gnudip.pgsql
File metadata and controls
78 lines (68 loc) · 2.47 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
74
75
76
77
/*
Commands to create PostgreSQL database
Edit this, then run using:
psql -U postgres template1 -f gnudip.pgsql
Or do it by hand using this to copy and paste.
*/
/*************************************/
/* create GnuDIP user */
create user gnudip password 'gnudippass';
/* ^GnuDIP user ^GnuDIP password */
/*************************************/
/* create GnuDIP database */
create database gnudip2;
/* ^GnuDIP database */
/*************************************/
/* use GnuDIP database */
\c gnudip2
/*************************************/
/* domains */
create sequence domains_id;
create table domains (
id integer default nextval('domains_id') not null,
domain varchar(50),
changepass varchar(5),
addself varchar(5),
primary key (id)
);
grant select, insert, update, delete on table domains_id to gnudip;
grant select, insert, update, delete on table domains to gnudip;
/* ^GnuDIP user */
/*************************************/
/* globalprefs */
create sequence globalprefs_id;
create table globalprefs (
id integer default nextval('globalprefs_id') not null,
param varchar(30),
value varchar(255),
primary key (id));
grant select, insert, update, delete on table globalprefs_id to gnudip;
grant select, insert, update, delete on table globalprefs to gnudip;
/* ^GnuDIP user */
/*************************************/
/* users */
create sequence users_id;
create table users (
id integer default nextval('users_id') not null,
username varchar(20) default '' not null,
password varchar(32),
domain varchar(50) default '' not null,
email varchar(50),
forwardurl varchar(60),
updated_secs int,
updated varchar(19),
level varchar(5) default 'USER' not null,
currentip varchar(15),
autourlon varchar(5),
MXvalue varchar(60),
MXbackup varchar(3) default 'NO' not null,
wildcard varchar(3) default 'NO' not null,
allowwild varchar(3) default 'NO' not null,
allowmx varchar(3) default 'NO' not null,
primary key (id)
);
create index users_domain on users (domain);
create index users_username on users (username);
grant select, insert, update, delete on table users_id to gnudip;
grant select, insert, update, delete on table users to gnudip;
/* ^GnuDIP user */