| 1 |
-- |
| 2 |
-- eurephia database schema for SQLite3 |
| 3 |
-- |
| 4 |
-- This SQL scripts updates the previous SQL schema to the |
| 5 |
-- new schema needed by edb-sqlite v1.3 |
| 6 |
-- |
| 7 |
-- GPLv2 only - Copyright (C) 2012 |
| 8 |
-- David Sommerseth <[email protected]> |
| 9 |
-- |
| 10 |
-- This program is free software; you can redistribute it and/or |
| 11 |
-- modify it under the terms of the GNU General Public License |
| 12 |
-- as published by the Free Software Foundation; version 2 |
| 13 |
-- of the License. |
| 14 |
-- |
| 15 |
-- This program is distributed in the hope that it will be useful, |
| 16 |
-- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 |
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 |
-- GNU General Public License for more details. |
| 19 |
-- |
| 20 |
-- You should have received a copy of the GNU General Public License |
| 21 |
-- along with this program; if not, write to the Free Software |
| 22 |
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 23 |
-- |
| 24 |
|
| 25 |
|
| 26 |
ALTER TABLE openvpn_lastlog ADD COLUMN vpnipv6addr varchar(48); |
| 27 |
|
| 28 |
-- openvpn_vpnaddr_history - This keeps an overview over which VPN client addresses |
| 29 |
-- a session have used, in case the client changes the address. |
| 30 |
-- This table replaces openvpn_macaddr_history. |
| 31 |
CREATE TABLE openvpn_vpnaddr_history ( |
| 32 |
sessionkey varchar(64) NOT NULL, |
| 33 |
macaddr varchar(20) NOT NULL, |
| 34 |
ip4addr varchar(32) , |
| 35 |
ip6addr varchar(48) , |
| 36 |
registered timestamp DEFAULT CURRENT_TIMESTAMP, |
| 37 |
semaid integer PRIMARY KEY AUTOINCREMENT |
| 38 |
); |
| 39 |
CREATE INDEX openvpn_vpnaddr_hist_sessionkey ON openvpn_vpnaddr_history(sessionkey); |
| 40 |
CREATE INDEX openvpn_vpnaddr_hist_macaddr ON openvpn_vpnaddr_history(macaddr); |
| 41 |
|
| 42 |
-- Copy over the old data from openvpn_macaddr_history to openvpn_vpnaddr_history |
| 43 |
INSERT INTO openvpn_vpnaddr_history (sessionkey, macaddr, registered, semaid) |
| 44 |
SELECT sessionkey, macaddr, registered, semaid |
| 45 |
FROM openvpn_macaddr_history |
| 46 |
ORDER BY semaid; |
| 47 |
|