2015-05-18 15:33:14 +02:00
|
|
|
DROP TABLE IF EXISTS users CASCADE;
|
|
|
|
DROP TABLE IF EXISTS arrowclicked CASCADE;
|
2015-05-18 09:52:04 +02:00
|
|
|
|
2015-05-18 11:11:06 +02:00
|
|
|
CREATE TABLE users (
|
2015-05-18 09:52:04 +02:00
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
name char(50)
|
|
|
|
);
|
2015-05-18 15:33:14 +02:00
|
|
|
|
|
|
|
-- Create dummy user
|
|
|
|
INSERT INTO users(name) VALUES('Thomas');
|
|
|
|
|
|
|
|
CREATE TABLE arrowclicked(
|
|
|
|
id SERIAL PRIMARY KEY,
|
|
|
|
user_id SERIAL REFERENCES users (id),
|
|
|
|
time TIMESTAMP DEFAULT NOW(),
|
|
|
|
arrow_id INTEGER
|
|
|
|
);
|
|
|
|
|