X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=install%2Fpostgres.sql;h=1d73dfcba2f294d46ecb25e20f0ce1190fb192e8;hb=43c7b978c31bcbf9e8e5202ecbb7b6fccba6a7fa;hp=9e0e82763058cc483423b65a7a7b5c80fd5f5273;hpb=f3e4f109a3ae6cd58e0abc9e909ac823d5e3065a;p=github%2Fwallabag%2Fwallabag.git diff --git a/install/postgres.sql b/install/postgres.sql index 9e0e8276..1d73dfcb 100644 --- a/install/postgres.sql +++ b/install/postgres.sql @@ -1,10 +1,10 @@ -CREATE TABLE config ( +CREATE TABLE IF NOT EXISTS config ( id bigserial primary key, name varchar(255) NOT NULL, value varchar(255) NOT NULL ); -CREATE TABLE entries ( +CREATE TABLE IF NOT EXISTS entries ( id bigserial primary key, title varchar(255) NOT NULL, url varchar(255) NOT NULL, @@ -14,7 +14,7 @@ CREATE TABLE entries ( user_id integer NOT NULL ); -CREATE TABLE users ( +CREATE TABLE IF NOT EXISTS users ( id bigserial primary key, username varchar(255) NOT NULL, password varchar(255) NOT NULL, @@ -22,9 +22,20 @@ CREATE TABLE users ( email varchar(255) NOT NULL ); -CREATE TABLE users_config ( +CREATE TABLE IF NOT EXISTS users_config ( id bigserial primary key, user_id integer NOT NULL, name varchar(255) NOT NULL, value varchar(255) NOT NULL -); \ No newline at end of file +); + +CREATE TABLE IF NOT EXISTS tags ( + id bigserial primary key, + value varchar(255) NOT NULL +); + +CREATE TABLE IF NOT EXISTS tags_entries ( + id bigserial primary key, + entry_id integer NOT NULL, + tag_id integer NOT NULL +)