summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-15 16:17:44 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-15 16:17:44 -0400
commit6c4e26fe61a3c1cada4775a42a929eb884150b2d (patch)
tree3d8f920f9207695e48da8963611796c02326cfbb
parent15eb0c020607d19ceda1149e830afb7033c18828 (diff)
Added sql files to handle attachments (not yet tested) Hoping someone will improve the postgres version.
-rw-r--r--db/laconica.sql59
-rw-r--r--db/laconica_pg.sql58
2 files changed, 117 insertions, 0 deletions
diff --git a/db/laconica.sql b/db/laconica.sql
index d9e21a7b5..344f0ff72 100644
--- a/db/laconica.sql
+++ b/db/laconica.sql
@@ -425,3 +425,62 @@ create table group_inbox (
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+create table file (
+ id integer primary key auto_increment,
+ url varchar(255), mimetype varchar(50),
+ size integer,
+ title varchar(255),
+ date integer(11),
+ protected integer(1),
+
+ unique(url)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+create table file_oembed (
+ id integer primary key auto_increment,
+ file_id integer,
+ version varchar(20),
+ type varchar(20),
+ provider varchar(50),
+ provider_url varchar(255),
+ width integer,
+ height integer,
+ html text,
+ title varchar(255),
+ author_name varchar(50),
+ author_url varchar(255),
+ url varchar(255),
+
+ unique(file_id)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+create table file_redirection (
+ id integer primary key auto_increment,
+ url varchar(255),
+ file_id integer,
+ redirections integer,
+ httpcode integer,
+
+ unique(url)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table file_thumbnail (
+ id integer primary key auto_increment,
+ file_id integer,
+ url varchar(255),
+ width integer,
+ height integer,
+
+ unique(file_id),
+ unique(url)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table file_to_post (
+ id integer primary key auto_increment,
+ file_id integer,
+ post_id integer,
+
+ unique(file_id, post_id)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+
diff --git a/db/laconica_pg.sql b/db/laconica_pg.sql
index a27a616f2..b213bbd50 100644
--- a/db/laconica_pg.sql
+++ b/db/laconica_pg.sql
@@ -427,6 +427,64 @@ create table group_inbox (
);
create index group_inbox_created_idx on group_inbox using btree(created);
+
+/*attachments and URLs stuff */
+create sequence file_seq;
+create table file (
+ id bigint default nextval('file_seq') primary key /* comment 'unique identifier' */,
+ url varchar(255) unique,
+ mimetype varchar(50),
+ size integer,
+ title varchar(255),
+ date integer(11),
+ protected integer(1)
+);
+
+create sequence file_oembed_seq;
+create table file_oembed (
+ id bigint default nextval('file_oembed_seq') primary key /* comment 'unique identifier' */,
+ file_id bigint unique,
+ version varchar(20),
+ type varchar(20),
+ provider varchar(50),
+ provider_url varchar(255),
+ width integer,
+ height integer,
+ html text,
+ title varchar(255),
+ author_name varchar(50),
+ author_url varchar(255),
+ url varchar(255),
+);
+
+create sequence file_redirection_seq;
+create table file_redirection (
+ id bigint default nextval('file_redirection_seq') primary key /* comment 'unique identifier' */,
+ url varchar(255) unique,
+ file_id bigint,
+ redirections integer,
+ httpcode integer
+);
+
+create sequence file_thumbnail_seq;
+create table file_thumbnail (
+ id bigint default nextval('file_thumbnail_seq') primary key /* comment 'unique identifier' */,
+ file_id bigint unique,
+ url varchar(255) unique,
+ width integer,
+ height integer
+);
+
+create sequence file_to_post_seq;
+create table file_to_post (
+ id bigint default nextval('file_to_post_seq') primary key /* comment 'unique identifier' */,
+ file_id bigint,
+ post_id bigint,
+
+ unique(file_id, post_id)
+);
+
+
/* Textsearch stuff */
create index textsearch_idx on profile using gist(textsearch);