From 69d8738688ebb72707fe377b7ce7c717407aea96 Mon Sep 17 00:00:00 2001
From: Yorhel <git@yorhel.nl>
Date: Mon, 12 Oct 2009 09:34:06 +0200
Subject: SQL: Converted changes.type to an ENUM

This is a very important column in a very important table, I hope I
didn't forget to update a piece of code somewhere...
---
 util/dump.sql | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'util/dump.sql')

diff --git a/util/dump.sql b/util/dump.sql
index c952c162..8a8d2c61 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -5,9 +5,10 @@ CREATE LANGUAGE plpgsql;
 
 -- data types
 
-CREATE TYPE anime_type  AS ENUM ('tv', 'ova', 'mov', 'oth', 'web', 'spe', 'mv');
-CREATE TYPE medium      AS ENUM ('cd', 'dvd', 'gdr', 'blr', 'flp', 'mrt', 'mem', 'umd', 'nod', 'in', 'otc');
-CREATE TYPE vn_relation AS ENUM ('seq', 'preq', 'set', 'alt', 'char', 'side', 'par', 'ser', 'fan', 'orig');
+CREATE TYPE anime_type   AS ENUM ('tv', 'ova', 'mov', 'oth', 'web', 'spe', 'mv');
+CREATE TYPE dbentry_type AS ENUM ('v', 'r', 'p');
+CREATE TYPE medium       AS ENUM ('cd', 'dvd', 'gdr', 'blr', 'flp', 'mrt', 'mem', 'umd', 'nod', 'in', 'otc');
+CREATE TYPE vn_relation  AS ENUM ('seq', 'preq', 'set', 'alt', 'char', 'side', 'par', 'ser', 'fan', 'orig');
 
 
 -----------------------------------------
@@ -30,7 +31,7 @@ CREATE TABLE anime (
 -- changes
 CREATE TABLE changes (
   id SERIAL NOT NULL PRIMARY KEY,
-  type smallint NOT NULL DEFAULT 0,
+  type dbentry_type NOT NULL,
   rev integer NOT NULL DEFAULT 1,
   added timestamptz NOT NULL DEFAULT NOW(),
   requester integer NOT NULL DEFAULT 0,
-- 
cgit v1.2.3

