1 2 3 4 5 6 7 8 9 10 11 12 13 14
CREATE TABLE connection ( id serial PRIMARY KEY, ip inet, port INT, timestamp TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP ); CREATE TABLE login_attempt ( id serial PRIMARY KEY, username text NOT NULL, password text NOT NULL, connection int references connection(id), timestamp TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP );