PostgreSQL support

master
inpos 2017-12-10 16:53:51 +03:00
parent 61e9aed4be
commit 7ec3f80305
2 changed files with 14 additions and 2 deletions

View File

@ -8,9 +8,9 @@ CREATE TABLE IF NOT EXISTS `defense` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`epoch` int(11) NOT NULL,
`type` tinyint(4) NOT NULL,
`ipaddr` varchar(40) NOT NULL,
`ipaddr` varchar(256) NOT NULL,
`data` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ;
-- --------------------------------------------------------
-- --------------------------------------------------------

12
sql/postgresql.sql 100644
View File

@ -0,0 +1,12 @@
CREATE SEQUENCE defense_seq;
CREATE TABLE IF NOT EXISTS defense (
id int NOT NULL DEFAULT NEXTVAL ('defense_seq'),
epoch int NOT NULL,
type smallint NOT NULL,
ipaddr varchar(256) NOT NULL,
data text NOT NULL,
PRIMARY KEY (id)
) ;
ALTER SEQUENCE defense_seq RESTART WITH 30;