From 44fd0faa23fc5abc2028c8400166c00b653e12b3 Mon Sep 17 00:00:00 2001
From: Justin Plock <jplock@users.noreply.github.com>
Date: Mon, 14 Apr 2014 09:40:35 -0400
Subject: Added IF NOT EXISTS

---
 install/postgres.sql | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'install/postgres.sql')

diff --git a/install/postgres.sql b/install/postgres.sql
index fe8f559c..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,20 +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
 );
 
-CREATE TABLE tags (
+CREATE TABLE IF NOT EXISTS tags (
   id bigserial primary key,
   value varchar(255) NOT NULL
 );
 
-CREATE TABLE tags_entries (
+CREATE TABLE IF NOT EXISTS tags_entries (
   id bigserial primary key,
   entry_id integer NOT NULL,
   tag_id integer NOT NULL
-)
\ No newline at end of file
+)
-- 
cgit v1.2.3

