Commit 5b782ad9 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Remove unused target types from targets table.

A cleanup of leftovers from old MongoDB comments database.
parent 47d87fc8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -80,3 +80,10 @@ FOR EACH ROW
    UPDATE comments
    SET tags = (SELECT tagstring FROM concatenated_tags ctags WHERE ctags.comment_id = comments.id)
    WHERE id = OLD.comment_id;


-- Remove unused target types

DELETE FROM targets WHERE type = 'unknown' OR type = 'challenge';

ALTER TABLE targets MODIFY COLUMN type ENUM('class', 'guide', 'video') NOT NULL DEFAULT 'class';
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ CREATE TABLE users (
CREATE TABLE targets (
    id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    domain VARCHAR(50) NOT NULL, -- combines sdk & version
    type ENUM('class', 'guide', 'video', 'unknown', 'challenge') NOT NULL DEFAULT 'class',
    type ENUM('class', 'guide', 'video') NOT NULL DEFAULT 'class',
    cls VARCHAR(100) NOT NULL,    -- "Ext.draw.Sprite"
    member VARCHAR(100) NOT NULL, -- "method-setAttributes"
    -- the whole target must be unique