diff options
Diffstat (limited to 'src/plugin/namestore/namestore-0001.sql')
-rw-r--r-- | src/plugin/namestore/namestore-0001.sql | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/plugin/namestore/namestore-0001.sql b/src/plugin/namestore/namestore-0001.sql new file mode 100644 index 000000000..bdfb31976 --- /dev/null +++ b/src/plugin/namestore/namestore-0001.sql | |||
@@ -0,0 +1,48 @@ | |||
1 | -- | ||
2 | -- This file is part of GNUnet | ||
3 | -- Copyright (C) 2014--2022 GNUnet e.V. | ||
4 | -- | ||
5 | -- GNUnet is free software; you can redistribute it and/or modify it under the | ||
6 | -- terms of the GNU General Public License as published by the Free Software | ||
7 | -- Foundation; either version 3, or (at your option) any later version. | ||
8 | -- | ||
9 | -- GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY | ||
10 | -- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
11 | -- A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
12 | -- | ||
13 | -- You should have received a copy of the GNU General Public License along with | ||
14 | -- GNUnet; see the file COPYING. If not, see <http://www.gnu.org/licenses/> | ||
15 | -- | ||
16 | |||
17 | -- Everything in one big transaction | ||
18 | BEGIN; | ||
19 | |||
20 | -- Check patch versioning is in place. | ||
21 | SELECT _v.register_patch('namestore-0001', NULL, NULL); | ||
22 | |||
23 | -------------------- Schema ---------------------------- | ||
24 | |||
25 | CREATE SCHEMA namestore; | ||
26 | COMMENT ON SCHEMA namestore IS 'gnunet-namestore data'; | ||
27 | |||
28 | SET search_path TO namestore; | ||
29 | |||
30 | CREATE TABLE ns098records ( | ||
31 | seq BIGSERIAL PRIMARY KEY, | ||
32 | zone_private_key BYTEA NOT NULL DEFAULT '', | ||
33 | pkey BYTEA DEFAULT '', | ||
34 | rvalue BYTEA NOT NULL DEFAULT '', | ||
35 | record_count INTEGER NOT NULL DEFAULT 0, | ||
36 | record_data BYTEA NOT NULL DEFAULT '', | ||
37 | label TEXT NOT NULL DEFAULT '', | ||
38 | CONSTRAINT zl UNIQUE (zone_private_key,label)); | ||
39 | |||
40 | CREATE INDEX IF NOT EXISTS ir_pkey_reverse | ||
41 | ON ns098records (zone_private_key,pkey); | ||
42 | CREATE INDEX IF NOT EXISTS ir_pkey_iter | ||
43 | ON ns098records (zone_private_key,seq); | ||
44 | CREATE INDEX IF NOT EXISTS ir_label | ||
45 | ON ns098records (label); | ||
46 | |||
47 | |||
48 | COMMIT; | ||