[odrs-web/production] trivial: Allow reloading SQL schema



commit fcf3040e7cd302deca1f53dc5a87c6c6a19ffba8
Author: Richard Hughes <richard hughsie com>
Date:   Tue Sep 27 12:09:20 2016 +0100

    trivial: Allow reloading SQL schema

 schema.sql |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/schema.sql b/schema.sql
index fa90b3b..46d8ec5 100644
--- a/schema.sql
+++ b/schema.sql
@@ -1,3 +1,4 @@
+DROP TABLE IF EXISTS reviews;
 CREATE TABLE reviews (
   review_id INT NOT NULL AUTO_INCREMENT,
   date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -17,6 +18,7 @@ CREATE TABLE reviews (
   reported INT DEFAULT 0,
   UNIQUE KEY id (review_id)
 ) CHARSET=utf8;
+DROP TABLE IF EXISTS votes;
 CREATE TABLE votes (
   vote_id INT NOT NULL AUTO_INCREMENT,
   date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -25,6 +27,7 @@ CREATE TABLE votes (
   review_id INT DEFAULT 0,
   UNIQUE KEY id (vote_id)
 ) CHARSET=utf8;
+DROP TABLE IF EXISTS users;
 CREATE TABLE users (
   user_id INT NOT NULL AUTO_INCREMENT,
   date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -34,6 +37,7 @@ CREATE TABLE users (
   password TEXT DEFAULT NULL,
   UNIQUE KEY id (user_id)
 ) CHARSET=utf8;
+DROP TABLE IF EXISTS eventlog;
 CREATE TABLE eventlog (
   eventlog_id INT NOT NULL AUTO_INCREMENT,
   date_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -44,6 +48,7 @@ CREATE TABLE eventlog (
   message TEXT DEFAULT NULL,
   UNIQUE KEY id (eventlog_id)
 ) CHARSET=utf8;
+DROP TABLE IF EXISTS analytics;
 CREATE TABLE analytics (
   datestr INT DEFAULT 0,
   app_id VARCHAR(64) DEFAULT NULL,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]