summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/0-create.psql30
1 files changed, 30 insertions, 0 deletions
diff --git a/db/0-create.psql b/db/0-create.psql
index 4725c08..5016aa2 100644
--- a/db/0-create.psql
+++ b/db/0-create.psql
@@ -6,6 +6,9 @@ CREATE TABLE users (
hash text NOT NULL,
email text NOT NULL,
created_on timestamp NOT NULL DEFAULT now(),
+ last_login timestamp,
+ created_ip cidr DEFAULT '0',
+ last_ip cidr DEFAULT '0',
is_admin boolean NOT NULL DEFAULT false,
avatar text NOT NULL DEFAULT '',
contact text NOT NULL DEFAULT '',
@@ -15,6 +18,15 @@ CREATE TABLE users (
);
CREATE INDEX users_nick_lowercase_idx ON users (lower(nick));
+-- ALTER TABLE users
+-- ADD COLUMN last_login timestamp;
+-- ALTER TABLE users
+-- ADD COLUMN created_ip cidr DEFAULT '0';
+-- ALTER TABLE users
+-- ADD COLUMN last_ip cidr DEFAULT '0';
+
+
+
CREATE TABLE rooms (
room_id SERIAL PRIMARY KEY,
key text UNIQUE NOT NULL,
@@ -105,3 +117,21 @@ CREATE TABLE invalid_feed_images (
);
CREATE INDEX invalid_feed_images_idx ON invalid_feed_images (image_url);
+
+CREATE TABLE avatars (
+ avatar_id SERIAL PRIMARY KEY,
+ user_id NOT NULL REFERENCES users,
+ created_on timestamp NOT NULL DEFAULT now(),
+ type text,
+ url text,
+ w integer,
+ h integer,
+ thumb text,
+ tw integer,
+ th integer
+);
+
+CREATE TABLE images (
+ image_id SERIAL PRIMARY KEY,
+
+); \ No newline at end of file